Here is a counterexample in the plane: Let $X$ be an annulus with two disjoint arcs attached to one of its boundary components, and $Y$ - an annulus with one arc attached to one of its boundary components and another arc attached to the other boundary component.
Wlodek Kuperberg
- 7.3k
- 28
- 60