How to create a stencil cutout in the floor to reveal geometry underneath?

I’m trying to create a cutout effect in a floor mesh using a stencil mask, so that part of a building underneath becomes visible. I have a separate mesh set up to act as the mask, and I’m using Custom Depth/Stencil for it.

The idea is to use a material to hide the floor where the stencil is, revealing what’s below. Has anyone done something similar or knows the best way to approach this?