Box mask

Hi,

I have a video track scene I am working. I have a box modeled over a building in the video. I need a tree model to appear as if it is behind the building in the video. I have a box tracked over the building. How can I use the box as a way to bring the video of the building in front of the tree model? Thanks

Edit: It seems simply making it a shadow catcher works.

I guess you could use the “Holdout” shader, that would make an object invisible but can hiding other objects too. But it is cycles only.
https://docs.blender.org/manual/en/latest/render/shader_nodes/shader/holdout.html