Invar-behavior occurring in many magnetic materials has long been of interest to materials science. Here, we show not only invar behavior of a continuous film of FePt but also even negative thermal expansion of FePt nanograins upon equilibrium heating. Yet, both samples exhibit pronounced transient expansion upon laser heating in femtosecond x-ray diffraction experiments. We show that the granular microstructure is essential to support the contractive out-of-plane stresses originating from in-plane expansion via the Poisson effect that add to the uniaxial contractive stress driven by spin disorder. We prove the spin contribution by saturating the magnetic excitations with a first laser pulse and then detecting the purely expansive response to a second pulse. The contractive spin stress is reestablished on the same 100-ps time scale that we observe for the recovery of the ferromagnetic order. Finite-element modeling of the mechanical response of FePt nanosystems confirms the morphology dependence of the dynamics.