Custom Depth Test

I need to perform analogue of what would be equals depth test manually in material between fragment depth and custom depth. Any pointers welcome.

Are you trying to do something like this? https://www.tomlooman.com/the-many-uses-of-custom-depth-in-unreal-4/