Mask out effect in the compositor
Ok, this should do the trick. Set the glare node's Mix
 value to 1. This will cause it to only output the glare, not the mixed image. Then, simply use an Add node to mix the glare onto the original image, using your black and white Mask imagein the Add node's Fac to Mask out where you want no glare. In the example below, black would be no glare and white would be full glare.