Masking smoke simulation with another renderlayer

Hello, i have this problem with mixing smoke simulation to real video footage.

My first idea was to render smoke simulation in one layer and then rendering another layer with model of walls in that, and then using the Zmap of that wall layer as video and then zmap of that smoke layer to tell where the smoke is. Too bad this doesn’t seem to work very well.

What would be the best way of masking so me parts out of 3D footage, because i have the scene all tracked up and i have the walls recreated in one layer.

Thanks in advance -fluoZor