5. Given that $n$ is the product of two distinct prime numbers. Then the number of positive integer solutions $(x, y)$ to the equation $\frac{1}{x}+\frac{1}{y}=\frac{1}{n}$ is ( ).
(A) 1
(B) 4
(C) 9
(D) infinitely many
5.C.

It is known that $x>n, y>n$. Let $x=n+t_{1}, y=n+t_{2}\left(t_{1}\right.$, $t_{2}$ be natural numbers). The original equation becomes $\frac{1}{n+t_{1}}+\frac{1}{n+t_{2}}=\frac{1}{n}$.

Simplifying, we get $t_{1} t_{2}=n^{2}$.
Let $n=a b(a, b$ both be prime numbers, and $a \neq b)$, then
$$
\begin{array}{l}
t_{1} t_{2}=(a b)^{2}=1 \times a \times a \times b \times b \\
=1 \times(a b)^{2}=a \times\left(a b^{2}\right)=b \times\left(a^{2} b\right) \\
=a^{2} \times b^{2}=a b \times a b=(a b)^{2} \times 1 \\
=\left(a b^{2}\right) \times a=\left(a^{2} b\right) \times b=b^{2} \times a^{2} .
\end{array}
$$

Therefore, the values of $t_{1}$ are $1, a, b, a b, (a b)^{2}, a b^{2}, a^{2} b, a^{2}$, $b^{2}$, and the corresponding values of $t_{2}$ are $(a b)^{2}, a b^{2}, a^{2} b, a b, 1, a, b$, $b^{2}, a^{2}$. Since there are 9 pairs of values for $t_{1}$ and $t_{2}$, the original equation has 9 pairs of values for $(x, y)$.