5. Given the equation of $\odot O$ is $x^{2}+y^{2}=4$, and the equation of $\odot M$ is
$$
(x-5 \cos \theta)^{2}+(y-5 \sin \theta)^{2}=1(\theta \in \mathbf{R}),
$$

a line is drawn from any point $P$ on $\odot M$ to $\odot O$, forming two tangents $P E$ and $P F$, with the points of tangency being $E$ and $F$. Then the minimum value of $\overrightarrow{P E} \cdot \overrightarrow{P F}$ is
5.6.

It is known that the center of $\odot M$ is on the circle $x^{2}+y^{2}=25$.
Let $|P E|=|P F|=d$.
In the right triangle $\triangle P E O$, it is easy to see that $P O \in[4,6], O E=2$.
Thus, $d \in[2 \sqrt{3}, 4 \sqrt{2}]$.
Let $\angle O P F=\theta$. Then $\tan \theta=\frac{|O E|}{|P E|}=\frac{2}{d}$.
Therefore, $\cos \angle E P F=\cos 2 \theta=\cos ^{2} \theta-\sin ^{2} \theta$
$$
\begin{array}{l}
=\frac{1-\tan ^{2} \theta}{1+\tan ^{2} \theta}=\frac{d^{2}-4}{d^{2}+4} . \\
\text { Also, } \overrightarrow{P E} \cdot \overrightarrow{P F}=|\overrightarrow{P E}||\overrightarrow{P F}| \cos \angle E P F \\
=d^{2} \cos \angle E P F,
\end{array}
$$

Thus, $\overrightarrow{P E} \cdot \overrightarrow{P F}=d^{2} \cdot \frac{d^{2}-4}{d^{2}+4}$
$$
=d^{2}+4+\frac{32}{d^{2}+4}-12 \text {. }
$$

Let $x=d^{2}+4 \in[16,36]$.
Since the function $f(x)=x+\frac{36}{x}$ is monotonically increasing in the interval $[16,36]$, when $d=2 \sqrt{3}$, $\overrightarrow{P E} \cdot \overrightarrow{P F}$ reaches its minimum value of 6.