Probably. It depends on how you have things set up. Say you have all your underlying elements in a precomp. In an outer comp, you apply the Lens Flare effect to the precomp layer. You could then have an expression like this on the Flare Brightness property:
p = effect("Lens Flare")("Flare Center");
s = sampleImage(p,[.5,.5],false,time);
rgbToHsl(s)[2]*100
I’m not sure about the matte layer, but depending on what you’re doing you can probably incorporate that into this expression as well.