# Homeomorphism between subspaces

Let $X,Y$ be topological spaces and $A\subset X, B\subset Y$. Suppose that $A\approx Y$ and $B\approx X$. Do we have that $X\approx Y$?

-

Let $A=(0,1)$, $X=[0,1]$, $B=[0,1]$, and $Y=(-1,2)$, all with the topology inherited from $\mathbb R$. Then these satisfy the conditions in your problem but $X$ and $Y$ are not homeomorphic.
$A=Y=(0,1)\cup(1,2) \subset X=\mathbb R$ and $B=(0,1)\subset Y=A=(0,1)\cup (1,2)$