Both the earth and the moon are subject to the gravitational force of the sun. As observed from the sun, the orbit of the moon [NCERT Exemplar]
As observed from the sun, two types of forces are acting on the moon: one is due to gravitational attraction between the sun and the moon and the other is due to gravitational attraction between the earth and the moon. Hence, total force on the moon is not central.