The near-stoichiometric Ni2MnGa ferromagnetic alloys are one of these smart materials, that show a great interest when they are deposited as a thin film by rf sputtering. These thin films of shape memory alloys (SMAs) are prospective materials for micro and nanosystem applications. However, the properties of the SMAs polycrystalline thin films depend strongly on their structure and internal stress, which develop during the sputtering process and also during the post-deposition annealing treatment. In this study, 1μm Ni55Mn23Ga22 thin films were deposited at 0.45 and 1 Pa of Ar and their composition, crystallographic structure, internal stress, indentation modulus, hardness and deflection induced by magnetic field were systematically studied as a function of the temperature of the silicon substrate ranging from 298 to 873 K and the vacuum annealing treatment at 873 K for 21 and 36 ks. A silicon wafer having a native amorphous thin SiOx buffer layer was used as a substrate. This substrate influences the microstructure and blocks the diffusion process during the heat treatment. The crystal structure of the martensitic phase in each film was changed systematically from bct or 10M or 14M. In addition, the evolution of the mechanical properties such as means stress, roughness, hardness and indentation modulus with the temperature (of substrate or of heat treatment) were measured and correlated to crystal structure and morphology changes. It is concluded that the response of a free-standing magnetic SMAs films to a magnetic field of 200 kA/m depends strongly on the martensitic structure, internal mechanical stress (mean and gradient) and magnetic properties. The free-standing annealed film at 873 K for 36 ks demonstrates a considerable magnetic actuation associated with bct or 10M or 14M martensitic structures.