Preserving depth when rendering in multipe layers (Cycles)
Yeah no problem,

On the flame render layers layer settings, under the Layer: blocks, there's a Mask Layer:   set of blocks.   Just select the corresponding layer for the cannon (so you're applying the cannon as a mask to the flame)



Below is an example using a cube and a sphere, the sphere occluding and masking the cube.



The Cubes' render layer output