We report out-of-equilibrium stabilization of the collective spin of an atomic ensemble through autonomous feedback by a driven optical cavity. For a magnetic field applied at an angle to the cavity axis, dispersive coupling to the cavity provides sensitivity to a combination of the longitudinal and transverse spin. Coherent backaction by cavity light onto the atoms, conditioned by the cavity susceptibility, stabilizes the spin state at an arbitrary energy. The setpoint tracking and closed-loop gain spectrum of the feedback system are characterized and found to agree closely with analytic predictions.