might be able to get around it by using a stencil mask in the outline post process material: How to Create Masks With the Custom Stencil Buffer | Tips & Tricks | Unreal Engine (youtube.com)
that's probably where i'd start - simply don't include the water There is/was a node for testing depth behind a surface that looks like it's specifically intended for this purpose on (probably) 5.2. I cant remember what it was called but if you search for depth in the materials nodes it should come up