DepthMask shader for AR?

Hi, is there any way of having something to be used as a DepthMask shader or a stencil layer to be used for AR elements to appear “inside” something (holes, boxes, portals etc.)
Thank you
G.