5. Let the circumcenter $P$ of $\triangle A B C$ satisfy
$$
\overrightarrow{A P}=\frac{2}{5}(\overrightarrow{A B}+\overrightarrow{A C}) \text {. }
$$

Then $\cos \angle B A C=$ $\qquad$
5. $\frac{1}{4}$.

Let $D$ be the midpoint of $B C$. According to the problem, point $P$ lies on segment $A D$ and does not coincide with $D$, thus $A B=A C$. Therefore, $\cos \angle B A C=\cos \angle B P D=\frac{D P}{B P}=\frac{D P}{A P}=\frac{1}{4}$.