The detection of vibrational excitations of individual molecules on surfaces by scanning tunneling spectroscopy does not obey strict selection rules but rather propensity rules. The experimental verification of these is challenging because it requires the independent variation of specific parameters, such as the electronic structure, while keeping the vibrational modes the same. Here, we make use of the versatile self-assembled structures of Fe-tetra-pyridyl-porphyrin molecules on a Au(111) surface. These exhibit different energy-level alignments of the frontier molecular orbitals, thus allowing the correlation of electronic structure and detection of vibrations. We identify up to seven vibrational modes in the tunneling spectra of the molecules in some of the arrangements, whereas we observe none in other structures. We find that the presence of vibrational excitations and their distribution along the molecule correlates with the observation of energetically low-lying molecular states. This correlation allows to explain the different numbers of vibrational signatures for molecules embedded within different structures as well as the bias asymmetry of the vibrational intensities within an individual molecule. Our observations are in agreement with a resonant enhancement of vibrations by the virtual excitation of electronic states.