Creating a mask from animations frames

I have a simple animated video that used black silhouettes on a white background, created with cut paper and a light table so the white is not totally flat. I was hoping to create a mask with the animation so that I can have a back ground video show though were the black animated images are moving and have another video replace the white background. I know how to key frame either just the white or black but I really just want to use the animation as two masking layers for two videos.
Is this possible.
Thanks
Is this possible.
Thanks