In this paper, we theoretically study the effect of quantum tunneling on the surface enhanced Raman scattering (SERS) of a generic molecule confined in sub-nanometer nanocavities formed by metallic dimers. The tunneling effect was described by the quantum corrected model in combination with finite element simulations. The SERS spectra were calculated by a density matrix method. Simulation results demonstrate that both the field enhancement and the molecular SERS spectra are very sensitive to the size of the cavity. By decreasing the gap size, the local field enhancement first increases then starts to be significantly suppressed as a result of the tunneling effect which neutralizes the positive and negative induced charges in the nanocavity. Consequently, the SERS intensity also experienced dramatic decrease in the short gap distance region. We also show that both the plasmonic enhancement to the local field and the enhanced molecular decay rates have to be taken into account to understand the SERS properties of the molecule in such sub-nanometer nanocavities. These results could be helpful for the understanding of the surface enhanced spectral properties of molecular systems at sub-nanometer nanocavities.