Production boats do not usually come with EOM temperature gauges so I would think you may have an aftermarket one which could have been designed and intended for automotive use and their weatherproofing is not up to marine standards. It could perhaps be possible to improve the weatherproofing in the back with liquid rubber but I would suspect most of it would enter through the glass seal, perhaps some penetrating oil might soften the rubber seal to tighten in space where humidity could be entering. The ultimate fix would be to replace the gauge but that may even come with a limited service life as age and the environment conspire against the best of gauges.