A current of spin-polarized electrons senses and controls the magnetic state of nanostructured materials. Obtaining similar electrical access to quantum spin systems, such as single-molecule magnets, is still in its infancy. Recent progress has been achieved by probing the spin system near thermal equilibrium. However, it is the elusive non-equilibrium properties of the excited states that govern the time evolution of such structures and will ultimately establish the feasibility of applications in data storage and quantum information processing. Here we use spin-polarized scanning tunnelling microscopy to pump electron spins of atoms on surfaces into highly excited states and sense the resulting spatial orientation of the spin. This electrical control culminates in complete inversion of the spin-state population and gives experimental access to the spin relaxation times of each excited state. The direction of current flow determines the orientation of the atoms spin, indicating that electrical switching and sensing of future magnetic bits is feasible in the quantum regime.