[Composure]How to get a object exclude matte

Hello, I am testing Composure. I want to composite media_plate between foreground actors and background actors. But part of foreground actors are behind the background actors(the floor). Like the first pic I attached. Part of stair are under/intersect ground, and if I add stair into foreground layer, it will include all of the stair. Usually with this case, I will use CustomDepth with Post Process to exclude the underground area and get the matte of above stair only(Like the second pic I attached). But I don’t know how to do it by using Composure.