Sprite sorting layers. How do I make an object C appear infront of object B but behind object A when object B is always infront of object A

Hello. Im talking about sorting layers. Im creating a 2D shooter game. I want to make an effect where every time an enemy gets hit, blood appears on walls. In this picture blue object is a wall, yellow object is a background and red object is blood. Sometimes blood spawns on the wall and half of it is on the wall and other half of it is on the background. Is there any simple way to make blood appear on walls only ? If talking about the picture make red object appear on blue but behind yellow with sorting layers? !

You can change the Z coordinate and the lower so like 0 -1 -2 -3 the higher the number the more it is in front of out of the other objects.
If that was what you were asking