That a pair $(Z,C)$ has the homotopy extension property means nothing else than that the inclusion $C \to Z$ is a cofibration (see Hatcher chapter 4.A).
The following facts are well-known:
Given a pushout diagram
$\require{AMScd}$
\begin{CD}
C @>{f'}>> D \\
@A{j}AA @A{j'}AA \\
A @>{f}>> B\end{CD}
where $j$ is a cofibration, then $j'$ is a also a cofibration. See for example A cofibration induces a cofibration.
Given a map $f : X \to Y$, the mapping cylinder $Z(f)$ occurs as the pushout
\begin{CD}
X \times I @>{f'}>> Z(f) \\
@A{i_0}AA @A{i_0'}AA \\
X @>{f}>> Y
\end{CD}
where $i_0(x) = (x,0)$. This can be shown by verifying that the universal property of the pushout is satisfied.
The map $i_0$ is a cofibration. If "+" denotes disjoint union, then also the map $i : X + X \to X \times I$ given by $i(x) = (x,0)$ on the first summand and $i(x) = (x,1)$ on the second summand is a cofibration. This is equivalent to the fact that $(X \times I, X \times \{0\})$ and $(X \times I, X \times \{0,1\})$ have the homotopy extension property which can be easily verified (use the "retraction criterion" in Hatcher p.14).
Now let "+" denote disjoint union. Consider the diagram
\begin{CD}
X \times I @>{f'}>> Z(f) \\
@A{i}AA @A{(i_0',i_1)}AA \\
X +X @>{f + id }>> Y + X
\end{CD}
where $f'$ is the map from 2. and $(i_0',i_1)(y) = i_0'(y), (i_0',i_1)(x) = [x,1]$. I leave it as an exercise to you to show this is a pushout diagram. Simply verify that it has the universal property where you may invoke 2. Alternatively you can use the explicit construction of the pushout and you will see that $Z(f)$ is the quotient of $X \times I + Y + X$ under the equivalence relation generated by $y \sim (f(x),0)$ and $x \sim (x,1)$.
But then 1. and 3. yield the desired result.