Object masking works on an object, not a layer.
Here’s a short clip of the mini-map PoC running:

Admittedly the mini-map is drawn once at the start, but it shouldn’t be onerous to add a small area as it gets generated. Here are the events for the gif above:
