How to use custom depth selectively for certain objects?

Sure thing.

1.) Select your actor → Details Panel → Actor → Advanced → Tags (+)

2.) Add a Tags Array Element by clicking the (+) sign

3.) Type in a name for your Tag, such as “Occluder” (or whatever you want to call it)

4.) In Blueprint, add the node “Get All Actors of Class with Tag”

On the node, be sure to use the “Actor Class” drop down to select the class you want to match.
Also, on the “Tag” input, be sure you type in the same exact tag name you used for the actor(s) you want to fetch.

From there you can, set the result as a variable, and fetch them using a For Each Loop on it to do whatever you need to do…such as setting Custom Depth on / off.