The electronic structure of the magnetic refrigerant Gd5Ge2Si2 has been experimentally investigated by photoemission and x-ray absorption spectroscopy. The resonant photoemission and x-ray absorption measurements performed across the Gd N4,5 and Gd M4,5 edges identify the position of Gd 4f multiplet lines, and assess the 4f occupancy (4f7) and the character of the states close to the Fermi edge. The presence of Gd 5d states in the valence band suggests that an indirect 5d exchange mechanism underlies the magnetic interactions between Gd 4f moments in Gd5Ge2Si2. From 175 to 300 K the first 4 eV of the valence band and the Gd partial density of states do not display clear variations. A significant change is instead detected in the photoemission spectra at higher binding energy, around 5.5 eV, likely associated to the variation of the bonding and antibonding Ge(Si) s bands across the phase transition.