I think I get it.
You will want to set the light depth and shadow depth:
The value is normalized from 0 to 1 which lets you setup your own values based on whatever depth you use for your layers/objects. A value of 1 is closest to the top and 0 is the bottom. So, you could lerp() between your maximum and minimum layer depth values for your lights and shadow casters.