Basically mask interaction is implemented using the stencil buffer, masks writing (incrementing or setting a value other than 0) to the stencil buffer, masked objects reading the stencil value and only rendering when either equal to 0 with visibility set to Outside mask
or larger than 0 (or ==
or >=
a certain value to support nested mask-hierarchies) for Inside mask
.
While we don't know a clean official way how to do this, you would need to write or use a shader which writes to the stencil buffer. Likely the write operation should increment the stencil buffer value (see the documentation page here) or set it to a constant value like 1 if on the first mask-level.
Just watch out for potential side effects when mixing your stencil shader with other Mask components, if perhaps other components rely on a certain stencil value to be set.