Cocycle superrigidity from higher rank lattices to $\mathrm{Out}(F_N)$