The ratio of the
gJ factor of
4He(23S1) to that of
87Rb(52S21) has been measured to a fractional accuracy of \ifmmode\pm\else\textpm\fi{}5\ifmmode\times\else\texttimes\fi{}${10}^{\ensuremath{-}8}$. The Rb atoms were optically pumped, and the
4He(23S1) Zeeman resonance was observed through a combination of spin-exchange collisions and spin-dependent Penning ionization. Linewidths as narrow as 220 Hz were observed for the
4He(23S1) Zeeman resonance. The accuracy of this experiment was limited by a systematic shift in the He
gJ factor that depended upon the intensity of the discharge used to excite the He atoms to the
23S1 state. Calculations indicate that transfer of coherence in spin-exchange collisions with free electrons contributes to this shift. The measured ratio $\frac{{g}_{J}(^{4}\mathrm{He}, 2^{3}S_{1})}{{g}_{J}(^{87}\mathrm{Rb}, 5^{2}S_{\frac{1}{2}})}=1\ensuremath{-}46.798(50)\ifmmode\times\else\texttimes\fi{}{10}^{\ensuremath{-}6}$. Using the previously measured ratio of the
gJ factors of the ground state of rubidium to the ground state of hydrogen, we determine the ratio $\frac{{g}_{J}(^{4}\mathrm{He}, 2^{3}S_{1})}{{g}_{J}(^{1}\mathrm{H}, 1^{2}S_{\frac{1}{2}})}=1\ensuremath{-}23.214(50)\ifmmode\times\else\texttimes\fi{}{10}^{\ensuremath{-}6}$. This result agrees with recent theoretical calculations and experimental determinations using atomic-beam techniques, but disagrees with an earlier experimental determination using optical-pumping techniques.