Consider the commutative diagram below with exact rows (from the long exact sequence of homotopy groups) and $f_1,f_2,f_4,f_5$ bijective ($f_1,f_2$ homomorphisms). Does it follow that $f_3$ is also bijective?

\begin{align} \matrix{ \pi_1(A)&\to&\pi_1(X)&\to&\pi_1(X,A)&\to&\pi_0(A)&\to&\pi_0(X) \cr \downarrow f_1&&\downarrow f_2&&\downarrow f_3&&\downarrow f_4&&\downarrow f_5 \cr\pi_1(B)&\to&\pi_1(Y)&\to&\pi_1(Y,B)&\to&\pi_0(B)&\to&\pi_0(Y)} \end{align}

The usual proof of the five-lemma by diagram chasing makes use of the fact that the consituents are groups and all maps involved are homomorphisms. Since there is no group structure for the six sets on the right ($\pi_0$ and relative $\pi_1$), it does not apply.

However, with arguments about connected components and loops/paths, it is easily shown in an analogous diagram-chasing fashion that $f_3$ has to be surjective. The tricky part seems to be the injectivity (if it works at all): In analogy to the usual five-lemma, one can show that $f_3[x]=0\Rightarrow[x]=0$, but of course this does not immediately give injectivity due to $f_3$ only being a map between sets.

Is there a way to show injectivity? If not, is there a counterexample where this adapted five-lemma fails?

Thanks!