Ultrafast laser techniques have revealed extraordinary spin dynamics in magnetic materials that equilibrium descriptions of magnetism cannot explain. Particularly important for future applications is understanding non-equilibrium spin dynamics following laser excitation on the nanoscale, yet the limited spatial resolution of optical laser techniques has impeded such nanoscale studies. Here we present ultrafast diffraction experiments with an X-ray laser that probes the nanoscale spin dynamics following optical laser excitation in the ferrimagnetic alloy GdFeCo, which exhibits macroscopic all-optical switching. Our study reveals that GdFeCo displays nanoscale chemical and magnetic inhomogeneities that affect the spin dynamics. In particular, we observe Gd spin reversal in Gd-rich nanoregions within the first picosecond driven by the non-local transfer of angular momentum from larger adjacent Fe-rich nanoregions. These results suggest that a magnetic material's microstructure can be engineered to control transient laser-excited spins, potentially allowing faster (~ 1 ps) spin reversal than in present technologies.