The Gyldén–Meshcherskii Problem (GMP) extends the classical two-body problem of Newton and Kepler by considering time-varying gravitating masses, an important extension of the two-body problem for modeling cometary motion and cosmological phenomena. In this paper, we consider the GMP in a specialized setup, the setup of gauge theory. We show that the variational equations, modeling the effect of the mass time variation on the orbital elements, can be derived by fixing a gauge of a particular form that is different from the Lagrange gauge. Thus, the orbital elements modeling the effect of a time-varying secondary mass are non-osculating. This implies that the trajectory of a celestial body whose mass is continuously changing cannot be approximated by a series of Keplerian orbits. Finally, we provide the first-order averaged equations written in terms of non-osculating elements.