5. In the spatial quadrilateral $ABCD$, it is known that $AB=2, BC=3, CD=4, DA=5$, then $\overrightarrow{AC} \cdot \overrightarrow{BD}=$
$$
\begin{array}{l}
\overrightarrow{A C}=\overrightarrow{A B}+\overrightarrow{B C}=\overrightarrow{A D}+\overrightarrow{D C}, \overrightarrow{B D}=\overrightarrow{B A}+\overrightarrow{A D}=\overrightarrow{B C}+\overrightarrow{C D}, \\
\text { then } 4 \overrightarrow{A C} \cdot \overrightarrow{B D}=(\overrightarrow{A B}+\overrightarrow{B C})(\overrightarrow{B A}+\overrightarrow{A D})+(\overrightarrow{A B}+\overrightarrow{B C})(\overrightarrow{B C}+\overrightarrow{C D}) \\
+(\overrightarrow{A D}+\overrightarrow{D C})(\overrightarrow{B A}+\overrightarrow{A D})+(\overrightarrow{A D}+\overrightarrow{D C})(\overrightarrow{B C}+\overrightarrow{C D}) \\
=-\overrightarrow{A B}^{2}+\overrightarrow{B C}^{2}+\overrightarrow{A D}^{2}-\overrightarrow{D C}^{2}+2(\overrightarrow{A B} \cdot \overrightarrow{C D}+\overrightarrow{B C} \cdot \overrightarrow{A D}). \\
\text { And } \overrightarrow{A B}+\overrightarrow{B C}+\overrightarrow{C D}+\overrightarrow{D A}=\mathbf{0} \Rightarrow(\overrightarrow{A B}+\overrightarrow{C D})^{2}=(\overrightarrow{B C}+\overrightarrow{D A})^{2} \\
\Rightarrow \overrightarrow{A B}^{2}+\overrightarrow{D C}^{2}+2 \overrightarrow{A B} \cdot \overrightarrow{C D}=\overrightarrow{B C}^{2}+\overrightarrow{A D}^{2}+2 \overrightarrow{B C} \cdot \overrightarrow{D A} \\
\Rightarrow 2(\overrightarrow{A B} \cdot \overrightarrow{C D}+\overrightarrow{B C} \cdot \overrightarrow{A D})=\overrightarrow{B C}^{2}+\overrightarrow{A D}^{2}-\left(\overrightarrow{A B}^{2}+\overrightarrow{D C}^{2}\right), \text { substituting into }(*) \text { we get } \\
\overrightarrow{A C} \cdot \overrightarrow{B D}=\frac{\overrightarrow{B C}^{2}+\overrightarrow{A D}^{2}-\left(\overrightarrow{A B}^{2}+\overrightarrow{D C}^{2}\right)}{2}=7 \\
\end{array}
$$