Second harmonic generation is strictly forbidden in centrosymmetric materials, within the electric dipole approximation. Recently, it was found that the centrosymmetric magnetic semiconductors EuTe and EuSe can generate near-gap second harmonics, if the system is submitted to an external magnetic field. Here, a theoretical model is presented, which well describes the observed phenomena. The model shows that second harmonic generation becomes efficient when the magnetic dipole oscillations between the band-edge excited states of the system, induced by the excitation light, enter the in-phase regime, which can be achieved by applying a magnetic field to the material.