You must install a working ground wire to the dash. With no ground to the dash, the ground is being supplied through the lamp filaments. The fuel gauge will work until you turn the lights on, then there is too high a resistance to ground for it to work.