Augmented Reality - WebGL

I’m building an AR application that displays cesium objects in front of a photosphere (360-degree photo).
A new building should be visible where it is not covered by existing buildings.

However, the existing building objects themselves should not be visible. You should see the facades from the photosphere.

The existing buildings should serve as a mask for other objects.

What options do I have?
Post processing and WebGL GLSL didn’t get me there.