Motion doesn't support using gobos with lights, so there's no automagic way to do it.
There are a couple of alternative approaches you could try, though. One would be simply to use a feathered shape (say, a white rectangle) instead of an actual light, with its transfer mode and/or opacity adjusted appropriately.
The other would be to duplicate whatever it is you want to be affected by a custom-shaped light, put all the groups from that duplicate into into a single new uber-group, apply your light, and then add an image mask to the uber-group in whatever shape you want the light to be. Does that make sense?