I use just the same kind of circuit and it works fine. Only if you're not controlling a pump or a motor you best use a smaller, cheaper NPN transistor, like a 2n2222 or equivalent. It is sufficient for up to a few hundred milliamps. OK for LEDs, small buzzer, 6V relay, etc. In this case, the resistor can be replaced by a 22kOhms or more, otherwise you will get false alarms. If the air contains lots of moisture in your area, condensation can occur when you put the sub in cold water.
Also, it is best to put two probes (in parallel), one at each end of the sub, that's where the water tends to accumulate when the boat is not level...
If you connect a LED, don't forget to add a resistor (in series): 1kOhms for 12v or 330Ohms for 6V.
Pins on the 2n2222 with TO-92 packaging:
(When looking at the flat side of the black plastic package)
E, B, C.