It is not possible in a straight-forward way.
You can, though, achieve a similiar result without tampering with the layer/label stacking order.
My example refers to a question marked as a duplicate.
The person asking said question had three layers: a base layer, a point layer which served for labelling, and a semi-transparent mask layer; in this order from bottom to top. They wanted the labels to be affected by the semi-transparent mask layer.
My approach uses the “join by location” tool from the Processing tool box to assign an extra attribute to the label layer, which later allows us to style the labels in a rule-based manner (the ones “behind” the mask being transparent themselves)
EDIT: I assume that your polygon layer has a column describing whether the mask is applied for the current feature or not. This column is the attribute you want to transfer in the
join by location step. In my case the column is called
masked and contains the values 0 and 1, respectively. You can also use any existing attribute of the polygons, just be sure to refer to the right attribute when you create the rules for styling the output layer (last step)
The results look like that: