I've tried numerous answers on this forum and tutorials, but for some reason I can't get this light to hide properly and still perform a glow effect. What I need is for the light (highlighted with a green rectangle) to hide properly, but still allow the blur and glare effect to show in the foreground.
Here is a screenshot of the node setup in the compositor:
And here is a screenshot of the issue:
EDIT: my attempt at LukeD's answer for reference.