There's two main ways to apply lights in a deferred renderer -- either by screen-space quads that cover the screen-space area of the light, or by 3D geometry that covers the volume of the light. Any deferred rendering tutorial that uses the latter technique will teach you how to apply light only to areas inside a meshes volume using the stencil buffer. You can use any aribtray, closed mesh to apply the lighting if you wanted to.
The projected light texture that Hodgman is talking about gives you similar, and probably way more control over the shape of the emission but is not the same as geometry clipping light shape. You would then be controlling the light shape with a texture instead of geometry. It works like a lot like a decal.
No matter which lighting technique you're using (deferred with quads, deferred with volumes, forward...), you can also apply projected gobo texture as part of the same lighting effect.
Googling "deferred rendering tutorial" and "projected texture tutorial" brings up a lot of hits.
Is there a tutorial about how to do something like this?