How to create a shader in Shader Graph that masks out the intersection of other objects?

I am working on masking/removing parts of a plane where it intersects with other objects. The goal is to be able to remove water from inside a submarine with a big window and the submarine is surfaced, like this:

So far, I have a Shader Graph that alpha masks objects except it seems to be doing it at any level and not during intersection. This gives the look that everything is always rendered on top of the plane, but I’m pretty sure it is masking (see shader graph below). Sorry if my terminology is off - I’m pretty new at shaders/shader speak.

With the help of bgolus, I was able to get this working:

https://forum.unity.com/threads/how-to-create-a-shader-in-shader-graph-that-masks-out-the-intersection-of-other-objects.638872/#post-4286815