The optically induced polarization of localized electron spins in an ensemble of quantum dots (QDs) dephases due to the interaction with the surrounding nuclear spins. Despite this dephasing, the spins in the QDs can be controlled to respond coherently by applying periodic laser pulses, leading to a revival of the spin polarization before each pulse. This effect, known as spin mode locking, strongly depends on an emerging selection of certain polarizations of the nuclear spin bath which is driven to a steady state far from equilibrium. We investigate the influence of the nuclear composition in InxGa1−xAs QDs on this nonequilibrium behavior and demonstrate that nuclear magnetic resonances (NMR) appear as very sharp dips in the revival signal. This suggests a novel kind of NMR spectroscopy.