A magnetically induced shape memory effect in Ni2MnGa results in huge magnetostrictive effects of several percent. Using x-ray absorption spectroscopy (XAS) and magnetic circular dichroism (XMCD) we investigated element specific magnetic moments and electronic structure of single crystalline, (110) oriented Ni2MnGa films on a-plane Al2O3 substrates in the austenite and martensite state. The structural phase transition of the samples is evident from temperature dependent x-ray diffraction and magnetization measurements. The Ni XAS differ significantly for temperatures above and below the martensite transition in agreement with published ab-initio calculations. Using XAS in transmission geometry on our thin film samples we observe the corresponding reduction of the absorption feature as predicted by theoretical calculations. The XMCD analysis shows the orbital contribution of the Ni electrons to be responsible for the magnetic anisotropy.