Rendering overlapping custom depth pass objects

I’m new to using Custom Depth Pass as a tool, and have only been using it for outlines thus far. The one problem that I’ve yet to solve is that when two objects drawn in the custom depth pass overlap, only their joint outline is drawn, while I’d like their individual outlines to be superimposed.
So, what I have right now is this:


And what I’d like to have is this, with the occluded portion of the sphere’s outline in orange, not red (No orange brush in Snip):


Is this possible using the custom depth pass? Is there an another way to get this effect?

I dont think its possible to get that effect without using transparency.

With a depth buffer you only have whats in the front, not the back. This will work only for one object using the buffer, and sampling the other in the standar depth, wich is odd and problematic in many cases. But nontheless it will work if you only want the sphere to be visible behind objects.

Hello Andrew,
how can I get what it’s seen in first image?

Thank you!