If I understand you correctly you’re trying to have a layer that is farther back in Z-space show up as though it is on top of a layer that is closer to the camera. This can be accomplished by putting the layer that is closer (“Front”) beneath the farther layer (“Back”) in the timeline then setting the “Front” layer to use “Back” as a Track Matte.
Make sure you use an ‘Alpha Inverted’ Track Matte so that the areas of the “Back” layer that are non-transparent cause the “Front” layer to become transparent (sorry if this is confusing, search in the After Effects help files for ‘Track Matte’). The last step would be to make the “Back” layer visible again (when you set a Track Matte AE automatically toggles the Track Matte layer’s visibility off).