5. Given $\odot O_{1}:(x+2)^{2}+(y-1)^{2}=1$ and $\odot O_{2}$ : $x^{2}+(y+1)^{2}=1$ are symmetric with respect to the line $l$. Then the equation of $l$ is ( ).
(A) $x+y+1=0$
(B) $x-y+1=0$
(C) $x-y-1=0$
(D) $x+y-1=0$
5. B.

Notice that, $o_{1}(-2,1), o_{2}(0,-1)$.
From the problem, we know that the line $l$ is the perpendicular bisector of the segment $O_{1} O_{2}$.
Therefore, the equation of the line $l$ is $x-y+1=0$.