5. The three sides of $\triangle A B C$ are $A B=a, B C$ $=b, C A=c$. If
$$
\left\{\begin{array}{l}
c=\sqrt{a^{2}-2}+\sqrt{b^{2}-2}, \\
a=\sqrt{b^{2}-3}+\sqrt{c^{2}-3}, \\
b=\sqrt{c^{2}-4}+\sqrt{a^{2}-4},
\end{array}\right.
$$

then the number of values less than 0 among $\boldsymbol{A B} \cdot \boldsymbol{B C}, \boldsymbol{B C} \cdot \boldsymbol{C A}, \boldsymbol{C A} \cdot \boldsymbol{A B}$ is $(\quad)$.
(A) 3
(B) 2
(C) 1
(D) 0
5.A.

As shown in Figure 5, construct $\mathrm{Rt} \triangle A B E$ with $a$ as the hypotenuse and $\sqrt{2}$ as one of the legs; construct $\mathrm{Rt} \triangle B C E$ with $b$ as the hypotenuse and $B E$ as one of the legs, such that $E C$ is on the extension of $A E$. Then
$$
\begin{array}{l}
C A=\sqrt{a^{2}-2}+\sqrt{b^{2}-2} \\
=c .
\end{array}
$$

Similarly, construct $\mathrm{Rt} \triangle C B F$, $\mathrm{Rt} \triangle C A F$, $\mathrm{Rt} \triangle A C D$, and $\mathrm{Rt} \triangle A B D$, such that $C F=\sqrt{3}$ and $A D=2$. We have
$$
\begin{array}{l}
A B=\sqrt{b^{2}-3}+\sqrt{c^{2}-3}=a, \\
B C=\sqrt{c^{2}-4}+\sqrt{a^{2}-4}=b .
\end{array}
$$

It is evident that the $\triangle A B C$ obtained in Figure 5 is congruent to the given triangle. The three altitudes of this triangle are $A D=2$, $B E=\sqrt{2}$, and $C F=\sqrt{3}$. By the area formula of a triangle, we have
$$
A B \cdot C F=B C \cdot A D=C A \cdot B E=2 S_{\triangle A B C} .
$$

Thus, $A B=\frac{2 S_{\triangle A B C}}{C F}=\frac{2}{\sqrt{3}} S_{\triangle A B C}$,
$$
\begin{array}{c}
B C=\frac{2 S_{\triangle A B C}}{A D}=S_{\triangle A B C}, \\
C A=\frac{2 S_{\triangle A B C}}{B E}=\sqrt{2} S_{\triangle A B C} .
\end{array}
$$

Therefore, the largest angle in $\triangle A B C$ is $\angle A B C$. By the cosine rule,
$$
\cos \angle A B C=\frac{A B^{2}+B C^{2}-C A^{2}}{2 A B \cdot B C}=\frac{\sqrt{3}}{12}>0 .
$$

It is clear that $\angle A B C$ is an acute angle, and $\triangle A B C$ is an acute triangle. Thus,
$$
\boldsymbol{A B} \cdot \boldsymbol{B C}=a b \cos (\pi-\angle A B C)<0 \text {. }
$$

Similarly, $B C \cdot C A<0$, and $C A \cdot A B<0$.