In oil wells by using the gauge for measuring pressure can use it to measure pressure gradient by taking steps every for example 500' and detect the different fluid contacts about the use of the values for gradient corresponds to oil, water, and gas:
In principle what appears to be a simple question, but there are a couple of obstacles on the road. If we are certain that we have genuine gas, oil and water pressures recorded at known tvd depths and we do know that both the gas-oil or oil-water system is in capillary drainage equilibrium plus that you have checked that your gas, oil and water hydrostatic gradients does not change with depth, then the answer is find the intersection depth (FOL) between the gas and oil gradient and subtract the capillary entry height for gas into oil or find the intersection depth (FWL) between the oil and water gradients and substract the capillary entry height for oil into water.
However, this was the easy solution and in the real world reservoir fluids are rarely in perfect capillary drainage equilibrium, gas/oil/water gradients as recorded by e.g. an MDT-log are rarely constant with depth, a MDT-log do often not record the true gas, oil or water pressure due to wettability issues etc. So in reality the simple solution is rarely correct and you need to include the effect of how you measure the pressure (wettability effect) and burial/charging history in your analysis.
So the real world is much more complex than the ideal situations we typically assume.