Cross section in cycles in blender 2.7
If I would be trying to achieve a cross section like effect, I wouldn't use the compositor but a mesh with a boolean modifier. In my opinion it's much more flexible. 

To accomplish this add a cube to our scene and position it to intersect with your object in the place you want gone. Then add a boolean modifier to  the object, select diffrence for the mode, and chose your masking cube. Be sure to disable renderability/hide the cube you masked the object with.

I have created an example in which the object being cross-sectioned is suzane in a box. You can download it here. Here's the example render and viewport screenshot.





While this method works with almost any render system, the blender internal and cycles have trouble with multimaterial objects. In that case just split it into separate objects with one material each.