Cycles masking object (blocking partial rendering of object)
Your link is broken so I can't see the method you're using.

You can continue like you are and render two images: one of the spheres with transparency on, one of just the background, and then composite them with the Compositor.  I don't believe you can use Render Layers here because the Tranparent option is not render-layer specific.

Or you can do what I did and use a cube to act as the building corner with the Boolean Modifier enabled:





Just make the corner cube invisible and set the following options: