Make objects with CustomDepth Pass visible through each other?

I have two objects with CustomDepth Pass. I want Object 1 (lines on the ground) to be visible when it’s behind Object 2 (half transparent box). I still want Object 2 to be visible through walls, so it needs CustomDepth Pass. Is it even possible to do this? Or do I have to find some way to combine the two into the same Stencil Value?