Example 11 Find all pairs of prime numbers $(p, q)$ such that $p^{2}+5 p q+4 q^{2}$ is a perfect square.
(64th Czech and Slovak Mathematical Olympiad)
If $p=q$, then $p^{2}+5 p q+4 q^{2}=10 p^{2}$ is not a perfect square.
Therefore, $p \neq q$.
Notice that, $p^{2}+5 p q+4 q^{2}=(p+q)(p+4 q)$.
Assume $(p+q, p+4 q)=(p+q, 3 q)=d$.
Since $q \nmid(p+q) \Rightarrow d=1$ or 3.
(1) If $d=1$, then $p+q$ and $p+4 q$ are both perfect squares.
Let $p+q=n^{2}, p+4 q=m^{2}$. Then
$3 q=(m+n)(m-n)$
$\Rightarrow(m-n, m+n)=(1,3 q)$ or $(3, q)$.
If $(m-n, m+n)=(1,3 q)$, then
$p+q=n^{2}=\left(\frac{3 q-1}{2}\right)^{2}$
$\Rightarrow p=\frac{q-1}{2} \times \frac{9 q-1}{2}$.
Since $p$ is a prime, $\frac{q-1}{2}=1$, at this time, $(p, q)=(13,3)$, which satisfies the requirement upon verification.
If $(m-n, m+n)=(3, q)$, then
$p+q=n^{2}=\left(\frac{q-3}{2}\right)^{2}$
$\Rightarrow p=\frac{q-1}{2} \times \frac{q-9}{2}$.
Since $p$ is a prime, $\frac{q-9}{2}=1$, at this time, $(p, q)=(5,11)$, which satisfies the requirement upon verification.
(2) If $d=3$, then $\left(\frac{p+q}{3}, \frac{p+4 q}{3}\right)=1$, and $\frac{p+q}{3} \times \frac{p+4 q}{3}$ is a perfect square.
Let $\frac{p+4 q}{3}=m^{2}, \frac{p+q}{3}=n^{2}$. Then
$q=(m+n)(m-n)$
$\Rightarrow m-n=1, m+n=q$
$\Rightarrow p+q=3 n^{2}=3\left(\frac{q-1}{2}\right)^{2}$
$\Rightarrow p=\frac{q-3}{2} \times \frac{3 q-1}{2}$.
Since $p$ is a prime, $\frac{q-3}{2}=1$, at this time, $(p, q)=(7,5)$, which satisfies the requirement upon verification.
In summary, $(p, q)=(13,3),(5,11),(7,5)$.
[Commentary] The perspective of solving the problem lies in factorization, analyzing the coprime conditions between the factors. In fact, if $(m, n)=d$, and $m n$ is a perfect square, then $\frac{m}{d}$ and $\frac{n}{d}$ are both perfect squares. To make the value of the algebraic expression a perfect square, successfully factorizing it is crucial.