The sensor (temp sensitive resistor) or over temp switch (bi-metal spring) are both grounded to the engine. The single wire from each goes to the panel. To tell which you are looking at you need a multimeter set to measure resistance (ohms). The switch will show infinite ohms all the time, the sensor will have a high but not infinite, resistance when the engine is cold. Once you know which type you have (do you even have a gauge BTW?) the wire goes to that gauge or idiot light. I'd not worry about the routing as long as the wire colors match on each end.