Is there a way to render overlapping geometry as different passes/layers?
I found a way with Cycles for my use case by using the Transparent Depth of the Light Path node.

A transparent shader is mixed with the original shader based on the pass index required. If the transparent depth is equal to the pass index, then it should use the original shader, otherwise it should be transparent.

Node setup:



Sphere 0-1 indexes:



Suzanne 0-3 indexes: