5. Fill $1,2, \cdots, n^{2}$ into an $n \times n$ chessboard, with each cell containing one number, and each row forming an arithmetic sequence with a common difference of 1. If any two of the $n$ numbers on the chessboard are neither in the same row nor in the same column, then the sum of these $n$ numbers is called a “basic sum”. If a basic sum is randomly selected, the probability that this basic sum equals the arithmetic mean of all basic sums is
5.1.

The numbers in the $k$-th row of the number table are
$$
(k-1) n+1,(k-1) n+2, \cdots,(k-1) n+n \text {. }
$$

Let the number taken from the $k$-th row be
$$
(k-1) n+a_{k} \text {. }
$$

Since these numbers are from different columns, $a_{1}, a_{2}, \cdots, a_{n}$ is a permutation of $1,2, \cdots, n$.
Therefore, the sum of the $n$ numbers taken is
$$
\begin{array}{l}
\sum_{k=1}^{n}\left[(k-1) n+a_{k}\right]=n \sum_{k=1}^{n}(k-1)+\sum_{k=1}^{n} a_{k} \\
=n \frac{n(n-1)}{2}+\frac{n(n+1)}{2}=\frac{n\left(n^{2}+1\right)}{2} .
\end{array}
$$

Thus, any basic sum is equal to the arithmetic mean of all basic sums.
Therefore, the required probability is 1.