could be the temp. sender unit. it is threaded into the
thermostat housing.

there are 2 of them, one for the ECU (the one pointing up)
and the one driving the gauge (pointing down).

I'd tap the thermostat housing / sensor and reconnect the
wires to sort out contact problems - if it doesn't help, a
new sender is cca. $20 and easy to replace.

T.