Molecular dynamics study of the influence of phase distribution on the response of two-phase nanocrystalline Fe95Ni05 samples with a gradient grained structure under shock loading was carried out. It was shown that the propagation of a shock wave causes direct and reverse FCC-BCC-FCC phase transformations in grains with the FCC structure, BCC-FCC/HCP phase transformations in lamellas with the BCC structure, as well as the nucleation of the HCP phase. The shock wave and the wave reflected from the rear surface initiated transformation of a significant part of the sample into the HCP phase. Shock wave propagation in the sample caused the appearance of two maxima on the curve of the time dependence of the HCP phase volume fraction. Time changes in the HCP phase fraction correlated with changes in the fraction of atoms belonging to intrinsic stacking faults and the dislocation density in the FCC phase. A large volume fraction of the intrinsic stacking faults, a higher dislocation density, and a lower volume fraction of the HCP phase were observed in the case of the sample with BCC lamellas only in one layer of grains compared to the sample with BCC lamellas in all grains under shock loading.