The symbols on the back of the gauge tell you that. I = +12 volts when the key is on. L = internal light if it has one. Ground symbol = ground. S = sender. The sender on the engine you have must match the gauge you have.
On the engine end, if it has one, the trim sender will be a white w/tan stripe. You do know that Merc and OMC trim gauges work opposite of each other, don't you? Do you know if the gauge you were given is for an OMC engine?