[proofplan]
Subtract the two lifted chain maps and prove that the difference is null-homotopic. The equality of the lifted maps on $M$ forces the degree-zero component of the difference to land in $\ker \varepsilon_Q$, and exactness of the resolution $Q_\bullet \to N$ identifies this kernel with $\operatorname{im} d_1^Q$. Projectivity of each $P_n$ then lets us lift the relevant defect map through the surjection $d_{n+1}^Q:Q_{n+1}\to \ker d_n^Q$. An induction constructs the homotopy maps $s_n:P_n\to Q_{n+1}$ and proves the homotopy identity in every degree.
[/proofplan]
[step:Subtract the two lifts and reduce to a null-homotopy problem]
Define, for each $n \geq 0$, the $R$-module homomorphism
\begin{align*}
a_n:P_n &\to Q_n \\
x &\mapsto g_n(x)-h_n(x).
\end{align*}
Since $g_\bullet$ and $h_\bullet$ are chain maps, for every $n \geq 1$ we have
\begin{align*}
d_n^Q \circ a_n
&= d_n^Q \circ g_n - d_n^Q \circ h_n \\
&= g_{n-1}\circ d_n^P - h_{n-1}\circ d_n^P \\
&= a_{n-1}\circ d_n^P.
\end{align*}
Thus $a_\bullet:P_\bullet\to Q_\bullet$ is a chain map.
Moreover, since $g_\bullet$ and $h_\bullet$ lift the same map $f:M\to N$,
\begin{align*}
\varepsilon_Q \circ a_0
&= \varepsilon_Q \circ g_0 - \varepsilon_Q \circ h_0 \\
&= f\circ \varepsilon_P - f\circ \varepsilon_P \\
&= 0.
\end{align*}
Therefore $a_\bullet$ is a chain map lifting the zero map $M\to N$. It remains to construct maps $s_n:P_n\to Q_{n+1}$ satisfying
\begin{align*}
a_n=d_{n+1}^Q\circ s_n+s_{n-1}\circ d_n^P
\end{align*}
for all $n\geq 0$, where $s_{-1}:=0$.
[/step]
[step:Lift the degree-zero map through $d_1^Q$]
Because $\varepsilon_Q\circ a_0=0$, the image of $a_0$ is contained in $\ker \varepsilon_Q$. Exactness of the augmented complex $Q_\bullet\to N$ at $Q_0$ gives
\begin{align*}
\ker \varepsilon_Q=\operatorname{im} d_1^Q.
\end{align*}
Let
\begin{align*}
\iota_0:\ker \varepsilon_Q \to Q_0
\end{align*}
denote the inclusion map. There is a unique $R$-module homomorphism
\begin{align*}
\bar a_0:P_0 \to \ker \varepsilon_Q
\end{align*}
such that $\iota_0\circ \bar a_0=a_0$.
The map
\begin{align*}
d_1^Q:Q_1\to \ker \varepsilon_Q
\end{align*}
is surjective when its codomain is restricted to $\ker \varepsilon_Q$, because $\operatorname{im}d_1^Q=\ker\varepsilon_Q$. Since $P_0$ is projective, the map $\bar a_0:P_0\to\ker\varepsilon_Q$ lifts through this surjection. Hence there exists an $R$-module homomorphism
\begin{align*}
s_0:P_0\to Q_1
\end{align*}
such that
\begin{align*}
d_1^Q\circ s_0=\bar a_0.
\end{align*}
Composing with the inclusion $\iota_0$ gives
\begin{align*}
d_1^Q\circ s_0=a_0.
\end{align*}
Since $s_{-1}:=0$, this is exactly the homotopy identity in degree $0$:
\begin{align*}
a_0=d_1^Q\circ s_0+s_{-1}\circ \varepsilon_P.
\end{align*}
[guided]
The degree-zero case is where the assumption that $g_\bullet$ and $h_\bullet$ lift the same map is used. Since
\begin{align*}
\varepsilon_Q\circ g_0=f\circ\varepsilon_P
\quad\text{and}\quad
\varepsilon_Q\circ h_0=f\circ\varepsilon_P,
\end{align*}
their difference satisfies
\begin{align*}
\varepsilon_Q\circ a_0=0.
\end{align*}
This means that $a_0:P_0\to Q_0$ lands in the submodule $\ker\varepsilon_Q\subset Q_0$.
Exactness of the projective resolution $Q_\bullet\to N$ at $Q_0$ says precisely that
\begin{align*}
\ker\varepsilon_Q=\operatorname{im}d_1^Q.
\end{align*}
Thus the map $a_0$ factors uniquely through the inclusion $\iota_0:\ker\varepsilon_Q\to Q_0$ as a map
\begin{align*}
\bar a_0:P_0\to \ker\varepsilon_Q.
\end{align*}
Now regard
\begin{align*}
d_1^Q:Q_1\to \ker\varepsilon_Q
\end{align*}
as a surjective map onto its image, which is $\ker\varepsilon_Q$. Since $P_0$ is projective, every map from $P_0$ into the target of a surjection lifts through that surjection. Applying projectivity to $\bar a_0:P_0\to\ker\varepsilon_Q$ gives an $R$-module homomorphism
\begin{align*}
s_0:P_0\to Q_1
\end{align*}
with
\begin{align*}
d_1^Q\circ s_0=\bar a_0.
\end{align*}
As a map into $Q_0$, this equality says
\begin{align*}
d_1^Q\circ s_0=a_0.
\end{align*}
This is the required homotopy formula in degree $0$, since the term involving $s_{-1}$ is declared to be zero.
[/guided]
[/step]
[step:Inductively lift each higher defect through exactness of $Q_\bullet$]
Assume that for some $n\geq 1$ the maps
\begin{align*}
s_0:P_0\to Q_1,\quad \dots,\quad s_{n-1}:P_{n-1}\to Q_n
\end{align*}
have been constructed and satisfy
\begin{align*}
a_k=d_{k+1}^Q\circ s_k+s_{k-1}\circ d_k^P
\end{align*}
for every $0\leq k\leq n-1$.
Define the $n$th defect map
\begin{align*}
b_n:P_n &\to Q_n \\
x &\mapsto a_n(x)-s_{n-1}(d_n^P(x)).
\end{align*}
We prove that $b_n$ lands in $\ker d_n^Q$. Using the chain-map identity for $a_\bullet$, the induction hypothesis in degree $n-1$, and the complex identity $d_{n-1}^P\circ d_n^P=0$, we obtain
\begin{align*}
d_n^Q\circ b_n
&=d_n^Q\circ a_n-d_n^Q\circ s_{n-1}\circ d_n^P\\
&=a_{n-1}\circ d_n^P-d_n^Q\circ s_{n-1}\circ d_n^P\\
&=\left(a_{n-1}-d_n^Q\circ s_{n-1}\right)\circ d_n^P\\
&=s_{n-2}\circ d_{n-1}^P\circ d_n^P\\
&=0.
\end{align*}
Here, when $n=1$, the expression $s_{n-2}$ means $s_{-1}=0$.
Let
\begin{align*}
\iota_n:\ker d_n^Q\to Q_n
\end{align*}
denote the inclusion map. Since $d_n^Q\circ b_n=0$, there is a unique $R$-module homomorphism
\begin{align*}
\bar b_n:P_n\to \ker d_n^Q
\end{align*}
such that $\iota_n\circ \bar b_n=b_n$.
Exactness of $Q_\bullet$ at $Q_n$ gives
\begin{align*}
\ker d_n^Q=\operatorname{im}d_{n+1}^Q.
\end{align*}
Thus
\begin{align*}
d_{n+1}^Q:Q_{n+1}\to \ker d_n^Q
\end{align*}
is surjective after restricting its codomain to $\ker d_n^Q$. Since $P_n$ is projective, the map $\bar b_n:P_n\to\ker d_n^Q$ lifts through this surjection. Therefore there exists an $R$-module homomorphism
\begin{align*}
s_n:P_n\to Q_{n+1}
\end{align*}
such that
\begin{align*}
d_{n+1}^Q\circ s_n=\bar b_n.
\end{align*}
As a map into $Q_n$, this gives
\begin{align*}
d_{n+1}^Q\circ s_n=b_n=a_n-s_{n-1}\circ d_n^P.
\end{align*}
Rearranging yields the homotopy identity in degree $n$:
\begin{align*}
a_n=d_{n+1}^Q\circ s_n+s_{n-1}\circ d_n^P.
\end{align*}
[guided]
Suppose the homotopy maps have already been built through degree $n-1$. The next goal is to find a map
\begin{align*}
s_n:P_n\to Q_{n+1}
\end{align*}
such that
\begin{align*}
a_n=d_{n+1}^Q\circ s_n+s_{n-1}\circ d_n^P.
\end{align*}
The term $s_{n-1}\circ d_n^P$ is already known, so the only part still needing construction is the difference
\begin{align*}
b_n:=a_n-s_{n-1}\circ d_n^P.
\end{align*}
This defines an $R$-module homomorphism $b_n:P_n\to Q_n$.
To lift $b_n$ through $d_{n+1}^Q$, we must first prove that $b_n$ lands in $\ker d_n^Q$, because exactness identifies $\ker d_n^Q$ with the image of $d_{n+1}^Q$. We compute:
\begin{align*}
d_n^Q\circ b_n
&=d_n^Q\circ a_n-d_n^Q\circ s_{n-1}\circ d_n^P.
\end{align*}
Since $a_\bullet$ is a chain map, $d_n^Q\circ a_n=a_{n-1}\circ d_n^P$. Hence
\begin{align*}
d_n^Q\circ b_n
&=a_{n-1}\circ d_n^P-d_n^Q\circ s_{n-1}\circ d_n^P\\
&=\left(a_{n-1}-d_n^Q\circ s_{n-1}\right)\circ d_n^P.
\end{align*}
The induction hypothesis in degree $n-1$ says
\begin{align*}
a_{n-1}=d_n^Q\circ s_{n-1}+s_{n-2}\circ d_{n-1}^P.
\end{align*}
Substituting this identity gives
\begin{align*}
d_n^Q\circ b_n
&=s_{n-2}\circ d_{n-1}^P\circ d_n^P.
\end{align*}
Because $P_\bullet$ is a chain complex, $d_{n-1}^P\circ d_n^P=0$, so
\begin{align*}
d_n^Q\circ b_n=0.
\end{align*}
When $n=1$, the same formula is valid because $s_{-1}$ was defined to be the zero map.
Thus $b_n$ factors through the inclusion $\iota_n:\ker d_n^Q\to Q_n$ as a map
\begin{align*}
\bar b_n:P_n\to\ker d_n^Q.
\end{align*}
Exactness of $Q_\bullet$ at $Q_n$ gives
\begin{align*}
\ker d_n^Q=\operatorname{im}d_{n+1}^Q.
\end{align*}
Therefore
\begin{align*}
d_{n+1}^Q:Q_{n+1}\to\ker d_n^Q
\end{align*}
is surjective when regarded as a map onto $\ker d_n^Q$. Since $P_n$ is projective, the map $\bar b_n$ lifts through this surjection. Hence there exists an $R$-module homomorphism
\begin{align*}
s_n:P_n\to Q_{n+1}
\end{align*}
with
\begin{align*}
d_{n+1}^Q\circ s_n=\bar b_n.
\end{align*}
Viewing both sides as maps into $Q_n$, this says
\begin{align*}
d_{n+1}^Q\circ s_n=b_n=a_n-s_{n-1}\circ d_n^P.
\end{align*}
Rearranging gives exactly
\begin{align*}
a_n=d_{n+1}^Q\circ s_n+s_{n-1}\circ d_n^P.
\end{align*}
[/guided]
[/step]
[step:Assemble the homotopy between the original chain maps]
By the degree-zero construction and the induction step, there exist $R$-module homomorphisms
\begin{align*}
s_n:P_n\to Q_{n+1}
\end{align*}
for every $n\geq 0$ such that
\begin{align*}
a_n=d_{n+1}^Q\circ s_n+s_{n-1}\circ d_n^P
\end{align*}
for every $n\geq 0$, with $s_{-1}:=0$. Since $a_n=g_n-h_n$, this becomes
\begin{align*}
g_n-h_n=d_{n+1}^Q\circ s_n+s_{n-1}\circ d_n^P
\end{align*}
for every $n\geq 0$. Hence $(s_n)_{n\geq 0}$ is a chain homotopy from $g_\bullet$ to $h_\bullet$. Therefore the two chain maps lifting $f:M\to N$ are chain homotopic.
[/step]