Is there an analogue to depth fade on opaque material?

Is there a way to achieve the effect on the opaque material, when with something overlapping the mesh with the material, then there will be a small line in the place of the overlap.
This can be easily done on transparent material using depht fade, but unfortunately opaque does not support it.

There’s pixel depth offset. Not the same, but similar: