Gas gauge started working all of a sudden.

It could also be part of your dash not grounding either. The plug from the harness could have a dirty spot etc..But the first thing to check on is the ground piece like stated that jumps from around the rubber line at the tank. Even if it's there doesn't mean it's making contact. Try cleaning both ends.