The composition dependent lattice parameter, phase stability, elastic moduli, and magnetic transition temperature of the Ni2+xMn1-xGa shape-memory alloys are studied by using the first-principles exact muffin-tin orbital method in combination with the coherent potential approximation. The lattice parameter and tetragonal shear modulus of the cubic L-21 austenite phase decreases linearly with increasing concentration x of excess Ni atoms. The heats of formation of both cubic L-21 and tetragonal beta''' phases and their difference increase with x, indicating decreasing stability of the cubic and tetragonal phases and increasing driving force for the L-21 to beta''' martensitic transition. Investigating the electronic density of states, we find that the Ni-induced decreasing phase stability can mainly be ascribed to the weakening of the covalent bonding between minority spin states of Ni and Ga. Using the computed parameters, the composition dependence of the martensitic transition temperature is discussed. The theoretical Curie temperature, estimated from the Heisenberg model in combination with the mean-field approximation, is larger for the beta''' phase than for the L-21 phase. For both phases, the Curie temperature decreases nearly linearly with increasing x.