Well, based on Riateche comments (thank you), I was able to find a solution to my problem.
In order to modify the stacking order between two non-sibling item, and because they have no common parents, I had to change the z-value of their topmost parent, ie the ones who are top-level items. Instead of trying to hide my link behind its end pin, I made the whole component, the one which contains the pin which emits my link, hide behind the other component, the one which are parent of the end pin. Because those two components are top-level items, the setZValue
method works.
Well, I agree that it doesn't really answer the original question, because, eventually, I had to rethink the problem in order to use two sibling/top-levels items, but it feels like the natural way of doing things, so... I don't think that there really exist a way to change the stack order between two non sibling items.