The electronic structure of TTF-TCNQ was studied by near-edge X-ray absorption fine structure (NEXAFS) spectroscopy in order to detect a spectroscopic signature of the phase transitions, especially that occurring at 54 K, which is related to a Peierls gap opening on the TCNQ stacks. All unoccupied TCNQ orbitals predicted by first-principles calculations and, in particular the pair σ∗(π(ag,b3u)), located in the cyano groups, are clearly resolved in our experimental data. The latter orbital was observed for the first time in our NEXAFS spectra. The temperature dependence of NEXAFS peak intensities gives evidence of a subtle modification of the electronic structure when the charge density wave (CDW) fluctuations develop as the Peierls transition of the TCNQ stacks is approached from higher temperatures. These changes are explained on the basis of the charge transfer, the shape of the lower empty TCNQ molecular orbitals and the deformation of TCNQ during the pre-transitional CDW fluctuations. Finally the data suggest that the internal stack deformation consisting in a substantial out of plane displacement of the central ring with respect to the cyano-groups allows to gain Cα-Cα bonding energy which helps the stabilization of the Peierls transition on the TCNQ stack.