Conditionally apply texture based on object behind?
You need to use the Geometry node with drivers




Basically Blender analyses each every portion of the mesh, and for that portion the Geometry node returns its position.
The Separate XYZ node extracts the height from that position vector 
The two Value nodes get their input from two drivers (in the picture there is one of them) that copy the Z position of the two planes





With the two Math nodes, set to Less Than, you calculate if that mesh portion is under one of the two planes. The values you get are 1s (White) or 0s (Black)
You can use those values as the factor input of two Mix shaders to get your final color


Of course if you have textures you can put them instead of the RGB nodes, replace the Mix nodes with Mix Shaders



EDIT

This is your setup in case of horizontal planes. In case of tilted planes there is more math involved, but it's absolutely possible