5. Find an array $\left(a_{1}, a_{2}, \cdots, a_{n}\right)\left(a_{1}<a_{2}<\cdots<a_{n}\right)$ consisting of $n$ distinct positive integers, such that for any non-negative integer $d$, we have
$$
\frac{\left(a_{1}+d\right)\left(a_{2}+d\right) \cdots\left(a_{n}+d\right)}{a_{1} a_{2} \cdots a_{n}} \in \mathbf{Z} .
$$
For any integer $d$, let
$$
M(d)=\frac{\left(a_{1}+d\right)\left(a_{2}+d\right) \cdots\left(a_{n}+d\right)}{a_{1} a_{2} \cdots a_{n}} .
$$

If for any non-negative integer $d$, $M(d)$ is an integer, then for any negative integer $d$, $M(d)$ is also an integer. This is because for $d=1$, consider
$$
M(-1)=\frac{\left(a_{1}-1\right)\left(a_{2}-1\right) \cdots\left(a_{n}-1\right)}{a_{1} a_{2} \cdots a_{n}} .
$$

Since for $1 \leqslant i \leqslant n$, we have
$$
0 < a_i - 1 < a_i,
$$

For $k$, consider
$$
\begin{array}{l}
M(-k) \\
=\frac{(-1)^{k-1}(k-1)!\left(a_{k}-k\right)\left(a_{k+1}-k\right) \cdots\left(a_{n}-k\right)}{(k-1)!a_{k} a_{k+1} \cdots a_{n}} \\
=\frac{(-1)^{k-1}\left(a_{k}-k\right)\left(a_{k+1}-k\right) \cdots\left(a_{n}-k\right)}{a_{k} a_{k+1} \cdots a_{n}} .
\end{array}
$$

Since for $k \leqslant i \leqslant n$, we have
$$
0 < a_{k}-k \leqslant a_{i}-k < a_{i},
$$

then
$$
\begin{array}{l}
0<\left(a_{k}-k\right)\left(a_{k+1}-k\right) \cdots\left(a_{n}-k\right) \\
<a_{k} a_{k+1} \cdots a_{n} .
\end{array}
$$

Thus, $0<|M(-k)|<1$, which contradicts the fact that $M(-k)$ is an integer.
Therefore, $a_{k}=k$.
In conclusion, the array that satisfies the condition is $(1,2, \cdots, n)$.