Lemma 1: If the morphism of groupoids $g:G\to H$ induces an isomorphism $G(x_0) \to H(g(x_0))$ for any object $x_0$, then $g$ is fully faithful restricted to each component of $G$.
Proof. Let $x_0,x_1$ be objects in the same component of $G$, so there exists a path $\kappa:x_0\rightsquigarrow x_1$. Then we have a bijection $r_\kappa: G(x_0) \to G(x_0,x_1)$ sending the loop $\lambda$ to the path $\lambda\kappa$. Likewise, there is a bijection $r_{g(\kappa)}: H(g(x_0)) \to H(g(x_0),g(x_1))$, and the equality $r_{g(\kappa)}g|_{G(x_0)} = g|_{G(x_0,x_1)}r_\kappa$ holds. Since $g|_{G(x_0)}$ is a bijection, so is $g|_{G(x_0,x_1)}$.
The next lemma is immediate from the fact that the path components of a space correspond to the components of its fundamental groupoid.
Lemma 2: If the map of spaces $f:X\to Y$ induces a bijection on $\pi_0$, then the induced morphism $\pi(f):\pi(X)\to\pi(Y)$ induces a bijection of components of the groupoids.
Corollary 1: If $f:X\to Y$ is a weak homotopy equivalence, then $\pi(f)$ gives a bijection between the components of $\pi(X)$ and those of $\pi(Y)$ and is fully faithful on each component.
Lemma 3: A morphism $g:G\to H$ of groupoids with the properties stated in corollary 1 is an equivalence of groupoids:
Proof. Since for any object $y$ of $H$, there is an object $x$ of $G$ mapped to the component of $y$, $g$ is essentially surjective. Also if $x_0$ and $x_1$ lie in distinct components of $G$, then the components of $g(x_0)$ and $g(x_1)$ are distinct. And if $x_0$ and $x_1$ are in the same component, then we have a bijection from their arrow set to that of their images. That means $g$ is essentially surjective and fully faithful.
Corollary 2: A weak homotopy equivalence induces an equivalence of fundamental groupoids.