This is a lemma from Freyd's Abelian Categories stated without proof.
In an abelian category, $$A\rightarrow S \rightarrowtail B = A \rightarrow B$$ if and only if $$A\rightarrow B \twoheadrightarrow \mathrm{coker}(S\rightarrowtail B)=0$$
The proof of the $\Downarrow$ direction is immediate, but I haven't managed to prove the $\Uparrow$ direction. Hints are appreciated.
I guess you want to prove that, given a morphism $f: A\to B$ and a subobject $j: S\rightarrowtail B$ with cokernel $\pi: B\twoheadrightarrow\text{coker}(S\rightarrowtail B)$ (in an abelian category), you have $f$ factoring through $j$ if and only if $\pi\circ f=0$?
For the direction "$\Leftarrow$" note that any monomorphism is the kernel of its cokernel.
You might also want to think of a counterexample in the (non-abelian) category of groups we were discussing yesterday in Quotient Objects in $\mathsf{Grp}$.