Put your black and white layer (we’ll call it A) above the layer you want to mask (B). Set the Track Matte (shows up as TrkMat in the timeline panel; you may need to hit the “Toggle Switches/Modes” button if you don’t see it) on layer B to Luma Matte. Anyplace that’s black in A will be transparent in B, anyplace white will be visible. Anything gray will give partial transparency.
Now, if A is a black layer with transparency, you’ll want to use an Alpha Matte. Same principle, but anyplace that’s opaque will be visible in B and anything transparent will likewise be transparent. If you’re going Alpha Matte, the opaque area color is irrelevant. It could be black, white, rainbow colored, a lovely photo of a sunset, doesn’t matter. All After Effects looks at is opacity.
—
It is easier to destroy than to create.
More fun, too.