This paper is dedicated to studying the Choquard equation \(\begin{aligned} -\Delta u+\left( V(x)-\frac{\theta }{|x|^2}\right) u =(I_{\alpha }*F(u))f(u), \quad x\in {\mathbb {R}}^{N}\setminus \{0\},\\ \end{aligned}\) where \(N\ge 3\) , \((N-4)_{+}<\alpha <N\) , \(0<\theta <\frac{(N-2)^2}{4}\) , \(f(u)=|u|^{\bar{p}-2}u+\frac{1}{\bar{p}}g(u)\) , \(F(u)=\bar{p}\int _0^u f(s)\textrm{d}s\) , \(\bar{p}=\frac{N+\alpha }{N-2}\) is the upper critical Hardy-Littlewood-Sobolev exponent and \(I_{\alpha }\) is the Riesz potential. By using some new variational and analytic techniques, we prove that the above problem admits a nontrivial solution under the “almost necessary” conditions on the perturbed term g, as well as some weak assumptions on the potential V.