blocking another material/mesh showing by masking from another materials opacity

thanks so much ! i think this describes my situation

imagine the below (blue and red) are just a plane with a material applied with their colors and a opacity mask with
shapes

you can see the blue material doesnt show through the red even though it is directly below the red and you just see the world.

i was thinking, could i use custom channels in project setting?