-- There's no limit to the distance of gravitational forces.
There's gravitational force between Pluto and the lint in your
pocket ... not much, but it's there, and it can be calculated.
So there's ALWAYS gravitational force between the Earth and the
spaceship, AND ALSO between the Moon and the spaceship.
Even before it's ever launched !
-- The Earth has about 80 times as much mass as the Moon has,
so you have to be much closer to the Moon before the gravitational
forces in each direction are equal.