Afaik there’s no other way than to render a separate mask pass and composit. Put a full screen rect, a copy of your light, and copies of all of your occluders into a subviewport, set rect’s material to “light only” and set subviewport to use transparent background. The pixels that the light doesn’t see should end up transparent.
In object’s shader, use subviewport texture’s inverse alpha as object’s alpha.