5. Let's introduce the function $g(x)=f(x)+(x-2021)^{2}-4$. For this function, the conditions $g(2019)=g(2020)=g(2021)=g(2022)=g(2023)=0$ are satisfied, meaning that the function $g(x)$ has 5 roots. Since it is a polynomial of the 5th degree, it has no other roots. Therefore,

$$
g(x)=(x-2019)(x-2020)(x-2021)(x-2022)(x-2023),
$$

and

$$
f(x)=(x-2019)(x-2020)(x-2021)(x-2022)(x-2023)-(x-2021)^{2}+4
$$

Thus,

$$
f(2018)=(-1)(-2)(-3)(-4)(-5)-(-3)^{2}+4=-120-9+4=-125
$$
Answer: -125. Answer to option: 7-2: -115. 7-3: 115. 7-4: 125.