Intersecting animated masks
Simply copy the two animated masks to the 4th footage file and set them to "Intersect" instead of "Add". Then they will only reveal the footage that they are applied to when they intersect with another mask. Then put this footage files layer ontop of the others.

Here a screenshot as a reference.