I'm looking for a way to render a mesh that resides inside another mesh, here is an image of what I mean:
I want the part of the monkey that is inside the cube to be rendered, so the result would look like this:
I know, I could achieve this using boolean operators, but this is prone to error due to not closed meshes, also because I will have cases, where multiple objects will lie inside the boundaries.

$\begingroup$Oh, I see the result in the background. That's certainly not what I want.$\endgroup$
– lukasz1985Sep 3 '15 at 13:22

$\begingroup$Sorry, my bad, didn't see the 2nd image you posted. This is still attainable with render layers, will update my answer in a bit to show how.$\endgroup$
– TLouskySep 3 '15 at 14:11

$\begingroup$Edited, have a look and see if this works for you.$\endgroup$
– TLouskySep 3 '15 at 14:24

$\begingroup$Yup, exactly what I wanted, now I'll have to figure out what you did there :). Sorry for posting this comment from a different accout, I'm having some serious problems tracking my SO accounts. I would certainly accept this answer if I could... Nevertheless, really, thanks a lot! :D$\endgroup$
– luke1985Sep 3 '15 at 14:33