It can't be done. There are no light inclusions/ exclusions in AE. You need to pre-compose the elements separately, then combine them in a third comp.
Since there are about a zillion ways to do this we need to see a screenshot of your project and to know what you used to create the light element. If all else fails, pre-compose your light element layer and put it on the bottom.
I'm trying to create a dark, 3D room and I thought that the candles would give a good aspect. Unfortunately I use a TV as a computer screen, so my pictures where too big for this forum, so I uploaded them somewhere else. Here are the screenshots:
1. With light
2. Without light
3. The Light element
4. The light element from another point of view
5. When I try to Pre-compose the candles
6. After I Pre-Compose the candles
As you can see, the candles are backed up a lot and the quality of them is reduced considerably as they are Pre-Composed.
I see only a little empty square when I click on your links.
Thank all of you guys! I finally did it! By accident, I discovered that if I Pre-Composed the Camera by itself, the candles will back up and reduce the quility. So, I duplicated the camera, and named it "Camera 2". Then I Pre-Composed the walls, light and Camera 1 in one single comp and I got the results I expected. Thank you very much! I appreciate it!