It is thus enough to find a $p$-group in which this does not hold. For instance, if we take a free group on $c$ generators in the variety of 2-nilpotent groups of exponent $p$ (exponent 4 if $p=2$) then it works: such a group is thus not (a quotient of) a fibered product of 2 2-generated groups if $c$ is large enough (saynamely $c\ge 6$ although it's not optimal), because its quotient by the normal subgroup generated by 4 elements is never abelian.
Edit: here's a proof of the latter fact (for odd prime $p$): the truncated Baker-Campbell-Hausdorff formula yields an equivalence between the categories of 2-nilpotents Lie algebras over $\mathbf{Z}/p\mathbf{Z}$ and 2-nilpotents groups of exponent dividing $p$. In the free 2-nilpotent Lie algebra $\mathfrak{f}$ on generators $X_1\dots,X_n$ (and over any field), the ideal generated by $X_1,\dots,X_k$ is spanned by $X_1,\dots,X_k$ and $[X_i,X_j]$ for $i\le k$ and $j\le n$; its intersection $W_k$ with $[\mathfrak{f},\mathfrak{f}]$ thus has dimension $f(k)=k(k-1)/2+k(n-k)$. Note that by construction, $f(k-1)+1\le f(k)$ for all $1\le k\le n-1$, because $[X_{k},X_{k+1}]\in W_k\smallsetminus W_{k-1}$. In particular, $f(k)<f(n)=\dim(\mathfrak{f})$ whenever $k\le n-2$, and $f(k)+s\le f(k+s)$ whenever $0\le k\le k+s\le n$. Now consider a subspace $V$ of dimension $m$ in $\mathfrak{f}$. Let $s$ be the dimension of its intersection with the derived subalgebra $[\mathfrak{f},\mathfrak{f}]$ and $k=m-s$, so $k$ is the dimension of the projection to the abelianization. Then up to an automorphism of the $\mathfrak{f}$, we can suppose that $V$ contains $X_1,\dots,X_k$, and hence if generated by those elements and $s$ elements of the derived subalgebra. So the ideal generated by $V$ has dimension $\le f(k)+s$, which is $\le f(k+s)=f(m)$ as we have seen. Thus if the ideal generated by $V$ contains $[\mathfrak{f},\mathfrak{f}]$ then $f(m)=n$, which implies $m\ge n-1$; in other words, the quotient of $\mathfrak{f}$ by any ideal generated by $\le n-2$ elements is non-abelian (of course it's optimal since killing $n-1$ canonical generators yields a 1-dimensional Lie algebra).
All these facts carry over to the group, because the equivalence of categories is the identity on the underlying sets: namely given odd $p$ and an 2-nilpotent $p$-group, there is a canonically defined addition and Lie algebra law yielding the group law by the Baker-Campbell-Hausdorff formula $(gh=g+h+(1/2)[g,h])$ and Lie subalgebras (resp ideals) coincide with subgroups (resp. normal subgroups), so the minimal number of generators in either sense is the same as a group or subalgebra, resp. as a normal subgroup or ideal. Of course another approach is to convert the previous proof to the group setting, which should not be hard, and would allow to encompass the case of 2-groups.