If you have replace the sending unit the only other components are guage and wire. The pos wire comes from the ign. post on the switch. The other wire runs to the switch which is a variable ground.
It doesn't work 99% of the time but every now and then it begins working until I shut down for the day.
Sounds to me like an intermittent connection on one of the wires.
Disconnect the wire at the wire from the switch. Turn on ignition and notice position of guage. It should be pegged one way. Now ground the wire. The needle should peg the other way. If not you have a problem.