We investigate the electronic and magnetic properties of the synthesized double perovskites ${\mathrm{Y}}_{2}{\mathrm{NiIrO}}_{6}$ and ${\mathrm{La}}_{2}{\mathrm{NiIrO}}_{6}$, using density functional calculations, crystal field theory, superexchange pictures, and Monte Carlo simulations. We find that both systems are antiferromagnetic (AFM) Mott insulators, with the high-spin ${\mathrm{Ni}}^{2+}\phantom{\rule{4pt}{0ex}}{t}_{2g}^{6}{e}_{g}^{2}$ ($S=1$) and the low-spin ${\mathrm{Ir}}^{4+}\phantom{\rule{4pt}{0ex}}{t}_{2g}^{5}$ ($S=1/2$) configurations. We address that their lattice distortion induces ${t}_{2g}\text{\ensuremath{-}}{e}_{g}$ orbital mixing and thus enables the normal ${\mathrm{Ni}}^{+}\text{\ensuremath{-}}{\mathrm{Ir}}^{5+}$ charge excitation with the electron hopping from the Ir `${t}_{2g}$' to Ni `${e}_{g}$' orbitals, which promotes the AFM ${\mathrm{Ni}}^{2+}\text{\ensuremath{-}}{\mathrm{Ir}}^{4+}$ coupling. Therefore, the increasing ${t}_{2g}\text{\ensuremath{-}}{e}_{g}$ mixing accounts for the enhanced ${T}_{\mathrm{N}}$ from the less distorted ${\mathrm{La}}_{2}{\mathrm{NiIrO}}_{6}$ to the more distorted ${\mathrm{Y}}_{2}{\mathrm{NiIrO}}_{6}$. Moreover, our test calculations find that in the otherwise ideally cubic ${\mathrm{Y}}_{2}{\mathrm{NiIrO}}_{6}$, the ${\mathrm{Ni}}^{+}\text{\ensuremath{-}}{\mathrm{Ir}}^{5+}$ charge excitation is forbidden, and only the abnormal ${\mathrm{Ni}}^{3+}\text{\ensuremath{-}}{\mathrm{Ir}}^{3+}$ excitation gives a weakly ferromagnetic behavior. Furthermore, we find that, owing to the crystal field splitting, Hund exchange, and broad band formation in the highly coordinated fcc sublattice, ${\mathrm{Ir}}^{4+}$ ions are not in the ${j}_{\mathrm{eff}}=1/2$ state but in the $S=1/2$ state carrying a finite orbital moment by spin-orbit coupling. This paper clarifies the varying magnetism in ${\mathrm{Y}}_{2}{\mathrm{NiIrO}}_{6}$ and ${\mathrm{La}}_{2}{\mathrm{NiIrO}}_{6}$ associated with the lattice distortions.