As I understood you have rendered this as a single frames. You can use VirtualDub to split or join your animation into parts starting with matching frame numbers, like for example base_frames25-80.avi, mask_frames25-80.avi, laptop_frames25-80.avi (avoid hard or better any compression). Then use wax 2.0 - import these 3 animations put the 'base' on the first layer, 'mask/matte' on the second with multiply blending mode (considering it's black shape of laptop on completly white background - if not use invert filter in VirtualDub first before importing) and the 'laptop' (laptop shape on the black background) on third layer with additive blending mode on top. Render the whole thing - if animations are matching with the size and time you shouldn't get halos around the moving shapes.
I know and I can give help how to work with these two programs. Other names I posted seems to be valuable too, but I haven't had time to investigate them further.
If you have any more questions - write here or PM me. I'll reply ASAP when I'll be available.