I've used an ultrasonic sensor to detect the water level in a tank before, I don't think it would work as you describe.
Also, the sensor didn't work in that context either as condensation kept forming on it.