The circuit and needle movement requires electricity to pull the needle up
Gravity pulls the needle down
A sticking needle can’t move up without the movement actively driving the needle high
I would be suspecting an intermittent open connection between the sending unit and the gauge in the dash
And since tapping the dash seems to resolve your sticking high needle
The possible intermittent connection is in the dash end of this situation.
While the needle is high, measure the voltage on the sender at the gas tank
Then tap the gauge to fix the sticking needle and see what the voltage at the tank changes to
-s
Isn’t the garage tied to switched power? How would it have electricity keeping it “up” with the key “off.”