5. In $\triangle A B C$, it is known that $A B=5, A C \leqslant 3, B C \geqslant 7$. Then the minimum value of $\angle C A B$ is ( ).
(A) $\frac{\pi}{2}$
(B) $\frac{2 \pi}{3}$
(C) $\frac{3 \pi}{4}$
(D) $\frac{5 \pi}{6}$
5.B.

From the cosine rule, we have
$$
\begin{array}{l}
\cos \angle CAB = \frac{AC^2 + 5^2 - BC^2}{2 \times 5 \times AC} \leq \frac{3^2 + 25 - 7^2}{10 \times AC} \\
= -\frac{15}{10 \times AC} \leq -\frac{15}{10 \times 3} = -\frac{1}{2}.
\end{array}
$$

Since the cosine function is decreasing in the interval $(0, \pi)$, therefore,
$$
\angle CAB \geq \frac{2 \pi}{3}.
$$