Enabling render custom depth to current area on the scene

Hi, i need to create a scanner like thermal vision, but with my own parameter for highlighting areas. I’ve tried to do this with post process, but result isn’t what i wanted. Maybe there is a method to apply “render custom depth” to the current area on the scene?

Thank’s!