Think of the unit square in $\mathbb{R}$ with the top and bottom edges identified with $a$ pointing right, and the left and right edges identified with $b$ pointing down. Now say your generator $c$ for $\pi_1(A\cap B)$ traverses the circle formed by $A\cap B$ once in the clockwise direction. When you include this into $B$, where does it go? By your retraction it goes to the boundary, and as it goes clockwise it runs along $aba^{-1}b^{-1}$.
Geometrically, picture $A$ as a disk on the surface of the torus, and $B$ as the rest of the torus (with a little overlap to make $A\cap B$). Then picture the circle $A\cap B$ staying still on the surface of the torus as you retract $B$ to the "frame" formed by $S^1\vee S^1$. If you were to include this circle into the frame by stretching it out, it would run along one circle, then the other, then the first in the reverse direction, then the second in reverse direction.
You can prove that
$$\mathbb R^3\setminus\{(0,0,z)\mid z\in\mathbb R\}\simeq \mathbb R^2\setminus\{(0,0)\}\simeq S^1,$$
where $\simeq$ means the spaces are homotopically equivalent. Since equivalent spaces have isomorphic fundamental groups, you're done.
Addition: Proving $A:=\Bbb R^2\setminus\{(0,0)\}\simeq S^1$: First we can define $i:S^1\to A$ to be just the inclusion map. Then take $r:A\to S^1$ to be
$$r(x)=\frac x{|x|}.$$
We want to show that $i\circ r\simeq \operatorname{id}_A$ and $r\circ i\simeq \operatorname{id}_{S^1}$. But $r\circ i$ is actually already equal to the identity function, so only the first one is left.
So, define $H:A\times I\to A$ by
$$H(x,t)=(1-t)\frac x{|x|}+tx$$
(for a fixed $x$, this is a straight line between $x/|x|$ and $x$). Note that $H$ is well defined and continuous. It is also easy to see that $H_0=i\circ r$ and $H_1=\operatorname{id}_A$.
Showing that $\Bbb R^3\setminus\{(0,0,z)\mid z\in\Bbb R\}\simeq\Bbb R^2\setminus\{(0,0)\}$ can be done in a similar way. Use the maps $r'(x,y,z)=(x,y)$ and $i'(x,y)=(x,y,0)$.
Best Answer
You can show that $\mathbb{R}^{3}$ minus a coordinate cross deformation retracts onto the 2-sphere minus four points. I would try and do this as follows: For any point in your space, put a line through the given point and the origin then do a straight line homotopy. Now pick one of the removed points on the 2-sphere as a pole and stereographically project onto $\mathbb{R}^{2}$ with three points removed. The fundamental group of this space is the same as a wedge of three circles: The free group on three generators.