How to get sprites to overlap after placement

So the game we are making has you stacking several boxes on top of one another. These boxes are 2D sprites and we are trying to figure out exactly how to get them to overlap since they are at a bit of an isometric view.

So from left to right it goes like this:

These boxes will be dragged onto a grid and dropped into place. When stacked or next to another box, we want them to overlap properly as seen in the middle image. Not behind one another or blocked by the edges like in the 3rd image.

Could anyone point us in the proper direction?

100794-example.png

The SpriteRenderer has the Sorting Layer and Order In Layer properties. Both can be used to sort sprites on their z-level. You usually use layers for groups like “front, mid and background”, while the order in layer defines which sprites are drawn above others within the same layer. Higher number, means rendered on top of lower numbers.