Hey @mediochera technically it should be feasible.
the basic principle is relatively simple to achieve https://protowlf.com/unreal/unreal-stencil-lights/ but I crammed many features in this shader and I haven't used Unreal since 4.2 so there might be some new technical limitations im not aware of.
Good luck!