ARE YOU FUCKING KIDDING ME?!?! SFML had a depth-buffer, then removed it because Laurent Gomila thought that a 2D library didn't need it.
Except, you DO need it. Sometimes you need to dynamically change the orders in which sprites are drawn, especially for 2.5D games just like what this linked article is talking about.
The article below talks about a solution using OpenGL and a derivative of SFML's vertex arrays, but that seems way too complex for something that should be dead simple. This is part of the reason why SFML will never be on the same level as SDL. I only use it because I have this weird urge to be different....to my own detriment.
https://jordansavant.com/book/graphics/sfml/sfml2_depth_buffering.md