Make a mesh mask

What i need is to mask objects inside any custom mesh, the object i need to mesh is an entire building full of stuff inside

What i’ve tried but couldn’t get the expected result:
BoxMask - 3D passing mesh parameters

NearestDF Method - since the entire building needs this material they also get each others DFs, and i would need it to check only a specific mesh DF (the mask object) (Also this method seems very expensive)

Custom Depth Stencil - Its relative to the camera and not to mesh bounds, so it wont work

Is this actualiy possible? To mask pixels based on the complex collision of a mesh?