5. Let positive integers $x, y$ satisfy
$$
x^{2}+84 x+2016=y^{2} \text {. }
$$

Then $x^{3}+y^{2}=$ $\qquad$
5. 12096.
$$
\begin{array}{l}
\text { Given } x^{2}+84 x+2016=y^{2} \\
\Rightarrow(x+42)^{2}+252=y^{2} \\
\Rightarrow y^{2}-(x+42)^{2}=252=2^{2} \times 3^{2} \times 7 \\
\Rightarrow(y+x+42)(y-x-42)=2^{2} \times 3^{2} \times 7 .
\end{array}
$$

Since $y+x+42>0$, it follows that $y-x-42>0$.
Notice that, $y+x+42$ and $y-x-42$ are both even, and $y+x+42>y-x-42$, and
$$
(y+x+42)-(y-x-42)=2 x+84 \geqslant 86,
$$

Therefore, it can only be
$$
\begin{array}{l}
\left\{\begin{array}{l}
y-x-42=2, \\
y+x+42=2 \times 63=126
\end{array}\right. \\
\Rightarrow\left\{\begin{array} { l } 
{ y - x = 4 4 , } \\
{ y + x = 8 4 }
\end{array} \Rightarrow \left\{\begin{array}{l}
x=20, \\
y=64
\end{array}\right.\right. \\
\Rightarrow x^{3}+y^{2}=20^{3}+64^{2}=12096 .
\end{array}
$$