Edit: this proof is wrong, $d$ cannot be defined as written.
We prove the statement for $f$ and $g$, being analogous in the other one.
Let us name $p:B\to coker (f)$ and $q:D \to coker (g)$.
First of all, notice that we can complete our diagram with a new map $\varphi:coker (f) \to coker (g)$.
Indeed, since $qbf=qga=(qg)a=0$, $qb:B \to coker(g)$ can be factorized via $coker(f)$. We then consider $d:D\to B$ determined by $1:B\to B$ and $0:C\to B$. $pdg=0$ since $dg=0$ by requirement, and so $pd$ factorizes through $q$: there exists $\psi: coker (g) \to coker (f)$ making
$$
\begin{array}{ccc}
D& \xrightarrow{f} & coker(g) \\[3pt]
\downarrow {d} & & \downarrow{\psi} \\
B& \xrightarrow{g} & coker(f)
\end{array}$$
commutative.
Next, it suffices to show that they are one the inverse of the other. Since $db=1$, we easily obtain $\psi\varphi p = p$ and because $p$ is an epimorphism $\psi\varphi=1$. In particular, notice that $\ker (\varphi) = 0 = coker( \psi)$. The other part is done by checking that $coker (\varphi)=0$. Let $h: coker (g) \to X$ be such that $h\varphi=0$. We consider the map from $D\to X$ given by $0=h\varphi p =hqb : B \to X$ and $0:C\to X$. The obtained map is trivially the zero one. On the other side, also $hq$ satisfies the required properties: $hqg=0:C \to X$ and $hqb=0:B\to X$. Therefore $hq=0$ because the morphism $D\to X$ is unique by definition. Since $q$ is an epimorphism, $h=0$ and so we have obtained that $h\varphi=0$ implies $h=0$. So, $coker(\varphi)=0$ and $\varphi$ is an epimorphism. Finally, $\varphi =\varphi 1 = \varphi \psi \varphi$ and by epimorphism property $\varphi\psi=1$.
In fact, the last part is too formal: in an abelian category every monomorphism is a kernel and every epimorphism is a cokernel, therefore it is easy to see that monomorphism and epimorphism implies isomorphism.
Sorry for being 2 years late.