If you use Roei Tzoref's solution choosing Color Matcher instead of Color Link will give you the same thing but you will have the ability to work in a high bit depth (32) comp without using the HDR Compander.
Rick Gerard it just occurred to me that "color matcher" is not a native Ae effect but a 3rd party plugin part of the Key Correct suite by Red giant so that's worth mentioning. of course the method you suggested with fill effect works fine for the purpose as well.