How can I move an object on a separate layer behind another in the compositor?
ID Mask:

Expanding on Gunslinger's answer, this can be done on two render layers, using an ID Mask node:


With the foreground object selected, set the Pass index to 1 in Object properties > Relations:


Enable the Object index pass in Render Layers > Passes:


Add an ID Mask node and set the Index to 1.
Plug the IndexOB output from the Renderlayer node into the ID Mask node. This will provide a mask for the foreground object:


Mix:



Gunslinger's setup is better as it preserves the sky:




Result:



Note that you can also use ID masks on a material basis.
Enable Material index in Render layers > Passes, and set the pass index for the material:

Use Materials > Settings > Pass index to set the pass index of the material in Cycles:



Or in Blender internal use Materials > Options > Pass index: