We studied surface-enhanced Raman spectroscopy (SERS) in 4-mercaptopyridine (4-Mpy) deposited on zinc oxide (ZnO) nanostructures, by using resonance Raman scattering covering a range of incident photon energies from 1.7 to 5.7 eV. We investigated all primary routes of the energy-specific resonances that are associated with the electronic transitions between the ZnO valence band (VB) to the lowest unoccupied molecular orbital (LUMO) and the highest occupied molecular orbital (HOMO) to the ZnO conduction band (CB), respectively. Two resonances at 5.55 and 5.15 eV in the ultraviolet (UV) spectral range can be associated with transitions into the CB and most importantly into an excitonic-related state below the ZnO CB, respectively. The energy difference between the UV resonances is 0.4 eV corresponding to the excitonic binding energy as a result of excitonic quantum confinement in the 10-20 nm thick ZnO nanowalls. The observed excitonic SERS resonance enhancement of the ring-breathing mode of 4-Mpy is about 15 times stronger than for the VB resonance observed at 2.43 eV and free of luminescence background. Hence, we outline new pathways of improving the detectability of molecules by chemical SERS due to tuning of the quantum confinement in the excitonic resonance enhancement.