5. Let $a$ be a real number, such that for any $x \in(-\infty, 1) \bigcup(5,+\infty)$, we have $x^{2}-2(a-2) x+a>0$. The set of all $a$ that satisfy the above requirement is
A. $(-\infty, 5]$
B. $(1,4)$
C. $(1,7]$
D. $(1,5]$
According to the problem, we have $\Delta=4(a-2)^{2}-4 a<0$ or $\left\{\begin{array}{l}1-2(a-2)+a \geqslant 0, \\ 25-10(a-2)+a \geqslant 0, \\ a-2 \in[1,5], \\ (a-2)^{2}-a \geqslant 0\end{array} \Rightarrow 1<a<4\right.$ or $4 \leqslant a \leqslant 5$,
Therefore, the answer is $D$.