5. Given the inequality $(x+y)\left(\frac{1}{x}+\frac{a}{y}\right) \geqslant 9$ holds for any positive real numbers $x, y$. Then the minimum value of the positive real number $a$ is ( ).
(A) 2
(B) 4
(C) 6
(D) 8
5.B.
$$
(x+y)\left(\frac{1}{x}+\frac{a}{y}\right)=1+a+\frac{y}{x}+\frac{a x}{y} \text {. }
$$

When $\frac{y}{x}=2$, $1+a+\frac{y}{x}+\frac{a x}{y}=3+\frac{3}{2} a$.
From $3+\frac{3}{2} a \geqslant 9$, we get $a \geqslant 4$.
$$
\text { Also, } 1+4+\frac{y}{x}+\frac{4 x}{y} \geqslant 5+2 \sqrt{\frac{y}{x} \cdot \frac{4 x}{y}}=9 \text {, }
$$

Thus, the minimum value of $a$ is 4.