hide outline post process effect behind objects

Hi, please excuse the noob question. I am new to the engine (realtime 3D alltogether)

I created an outline effect following the instructions in this tutorial

It worked fine, I am prefectly happy with the outline. Only thing is, that it is displayed through objects that are in front of the object with the outline

If I activate the option “Render CustomDepth Pass” for the cube the outlines of the blue object are blocked, but the cube gets its own outlines. That is something I don’t want.
I basically want some objects rendered with an outline (similar to some cell shading games) and other objects without outlines.

Is there something I am missing?

Here is the material I am using:

Thanks in advance

I thought this would be a rather simple question with an easy solution. Maybe that I did something wrong, forget a check-box or miss a connection.
I guess it is not then.
Is there another way to achieve the desired result?