Changes of the electronic and magnetic structure near the martensitic phase transition of Ni-Mn-In Heusler alloys dopedwith Co are investigated by experiment and theory. The nonstoichiometric Ni48Co5Mn35In12 epitaxial film undergoes a transition from a weakly magnetic martensitic phase below T-m = 350 K to a ferromagnetic austenitic phase above T-m. Element-specific magnetic moments and the unoccupied density of states function is investigated using x-raymagnetic circular dichroism.We find an antiparallel alignment ofMnandNi/Comagnetic moments in both phases. The electronic structure is calculated using the SPR-KKR Green's function approach considering experimental results on the atomic disorder in the sample. The good agreement of experimental and theoretically simulated x-ray absorption spectra in both phases confirms that a band Jahn-Teller like lifting of a degenerate d state is the origin of the energetic preference of the martensitic phase at low temperatures.