5. Given the six edges of a tetrahedron are $\sqrt{5}$, $\sqrt{3}$, $\sqrt{2}$, $\sqrt{2}$, $\sqrt{2}$, and $\sqrt{2}$. Then the cosine of the angle between the two longer edges is $\qquad$.
5. $\frac{\sqrt{15}}{5}$.

In Figure 2, in the tetrahedron $A-BCD$,
$$
AB=\sqrt{5} \text {. }
$$

If the two longer edges are skew lines, then
$$
CD=\sqrt{3} \text {. }
$$

Take the midpoint $E$ of $CD$, and connect $AE$ and $BE$.
In the isosceles triangle, we have
$$
AE=BE=\sqrt{(\sqrt{2})^{2}-\left(\frac{\sqrt{3}}{2}\right)^{2}}=\frac{\sqrt{5}}{2} \text {. }
$$

Then $AE + BE = \sqrt{5} = AB$, which contradicts the "sum of two sides of a triangle is greater than the third side."
Therefore, the two longer edges intersect.
Without loss of generality, assume in $\triangle ABC$,
$$
AB=\sqrt{5}, AC=\sqrt{3}, BC=\sqrt{2} \text {. }
$$

Then the cosine of the angle between the two longer edges is
$$
\cos \angle BAC=\frac{AB^{2}+AC^{2}-BC^{2}}{2 AB \cdot AC}=\frac{\sqrt{15}}{5}
$$