5. Divide the positive integers $1,2, \cdots, 7$ into two groups in any way, such that each group has at least one number. Then the probability that the sum of the numbers in the first group is equal to the sum of the numbers in the second group is $\qquad$
5. $\frac{4}{63}$.

There are $2^{7}-2=126$ possible scenarios.
Notice that $1+2+\cdots+7=28$.
Therefore, when the sums of the two groups of numbers are equal, the value of the sum is 14. At this point, the first group of numbers must contain at least one of the numbers $5,6,7$. Thus,
when the first group of numbers contains 5, there are four scenarios:
$$
\{2,3,4,5\},\{1,2,5,6\},\{3,5,6\},\{2,5,7\} \text {; }
$$

when it does not contain 5 but contains 6, there are two scenarios:
$$
\{1,3,4,6\},\{1,6,7\} \text {; }
$$

when it does not contain 5 and 6 but contains 7, there are two scenarios:
$$
\{1,2,4,7\},\{3,4,7\} \text {; }
$$

Therefore, there are a total of eight scenarios.
Thus, the required probability is $\frac{8}{126}=\frac{4}{63}$.