Masking with shapes

Is there a way to use shapes as mask? Like, everything what you choose, will be rendered, if it’s inside a specific object, like so:
https://dl.dropboxusercontent.com/u/33748093/Demo.gif
I know that it’s maybe possible in cycles nodes with light path, but I want an easier way, like some sort of “mesh mask” modifier

It’s possible with render layers at least. Could use masking object, place it in another scene layer and then enable that as mask layer, z mask, invert in render layer properties