The magnetic coupling between Mn atoms on Ga sublattice (Mn-Ga) and Mn atoms on Mn sublattice (Mn-Mn) in Ni2Mn1+xGa1-x alloy and its effect on the elastic modulus of the alloy are investigated by the use of first-principles methods. It is shown that, for x = 0.25, the state with antiparallel Mn-Ga-Mn-Mn magnetic coupling is slightly more stable than that with parallel coupling, whereas for x = 0.10, both magnetic states are almost degenerated. For both antiparallel and parallel Mn-Ga-Mn-Mn magnetic couplings, the bulk modulus (B) of Ni2Mn1+xGa1-x deviates from the general e/a-B relationship with e/a being the number of valence electrons per atom. The shear modulus C' versus the martensitic transformation temperature T-M for Ni2Mn1+xGa1-x with antiparallel Mn-Ga-Mn-Mn magnetic coupling is in line with the general C'-T-M relationship for Ni2MnGa-based alloys, in contrast to the case of parallel Mn-Ga-Mn-Mn magnetic coupling.