Hi there, welcome to iboats!
That wire looks like it may go to one of the two volvo penta exhaust riser temperature sensors as seen in item number 5 in the image below.
If it not the exhaust riser, then it will be part of the engine temperature gauge especially if the gauge doesn't seem to be working?.