I use it on every electrical connection in my truck, but it does exactly what your asking- exclude environment while not causing shorts through conduction.
If it’s very hot you may want to find a thicker variant. I use Molykote 111 for watch gaskets (and plasma gun o-rings) and it is much more...