Classical Cepheids (CCs) are at the heart of the empirical extragalactic distance ladder. Milky Way CCs are the only stars of this class accessible to trigonometric parallax measurements. Until recently, the most accurate trigonometric parallaxes of Milky Way CCs were the HST/FGS measurements collected by Benedict et al. (2002, 2007). Unfortunately, the second Gaia data release (GDR2) has not yet delivered reliable parallaxes for Galactic CCs, failing to replace the HST/FGS sample as the foundation of all Galactic calibrations of the Leavitt law. We aim at calibrating independently the Leavitt law of Milky Way CCs based on the GDR2 catalog of trigonometric parallaxes. As a proxy for the parallaxes of a sample of 23 Galactic CCs, we adopt the GDR2 parallaxes of their spatially resolved companions. As the latter are unsaturated, photometrically stable stars, this novel approach allows us to bypass the GDR2 bias on the parallax of the CCs that is induced by saturation and variability. We present new Galactic calibrations of the Leavitt law in the J, H, K, V, Wesenheit WH and Wesenheit WVK bands based on the GDR2 parallaxes of the CC companions. We show that the adopted value of the zero point of the GDR2 parallaxes, within a reasonable range, has a limited impact on our Leavitt law calibration. However, we find a significant difference with respect to the calibration based on the HST/FGS parallaxes, that corresponds to an FGS parallax zero point offset of approx. +0.2 mas. The discrepancy that we observe between the GDR2 and HST/FGS parallaxes has important consequences on the existing Galactic calibrations of the Leavitt law. We note that our results translate into a Hubble constant of 68.43 +/- 2.08 km/s/Mpc and 69.30 +/- 2.08 km/s/Mpc for a GDR2 parallax offset of 0.029 mas and 0.046 mas, respectively.