Maybe a dumb question, but you installed the sensor for it too right?
Easy way to test to see if it is a faulty gauge is to connect a wire to the sensor connection on the gauge and tap the other end if other against an earth. If its working the needle on the gauge will jump to max.
You can do the same thing with the end of the wire at the sensor. If that checks out your gauge and wiring appear good and its a faulty sensor. Though I have never seen one fail before.