Stencil buffer and non euclidean geometry

I have this project I made in another game engine using the stencil buffer to do non euclidean spaces.

The idea is portals and sectors with the portals only rendering sectors.

On the parts of the map where the areas overlap, they are separate parts of the game map and are two different stencil values rendered only by the portals.

When you enter the portal trigger box, the stencil area is rendered normally.

The portal plane checks if the player camera is in front or behind it using a plane distance script.

If you exit on the positive side of the portal then the stencil area is rendered by the portal.

If you exit on the negative side of the portal then the stencil area is rendered normally.

The stencil area is only rendered by the portal and is invisible.

The collision is different meshes are switched when entering a stencil area.

When a item or enemy is in the stencil area they are rendered by the portals.

When the player enters a stencil area the items and enemy are rendered normally.

The overlapping areas can’t interact with objects inside different stencil area.

Separate collision mesh for the stencil areas.

I don’t know exactly if Unreal can do this.

Can actors stencil number change and be rendered by portals?

I need to turn stencil rendering on or off and change the reference number on enemy actors.