We present a scanning tunneling microscopy (STM) and ab-initio study of the anisotropic superconductivity of 2H-NbSe2 in the charge-density-wave (CDW) phase. Differential-conductance spectra show a clear double-peak structure, which is well reproduced by density functional theory simulations enabling full k- and real-space resolution of the superconducting gap. The hollow-centered (HC) and chalcogen-centered (CC) CDW patterns observed in the experiment are mapped onto separate van der Waals layers with different electronic properties. We identify the CC layer as the high-gap region responsible for the main STM peak. Remarkably, this region belongs to the same Fermi surface sheet that is broken by the CDW gap opening. Simulations reveal a highly anisotropic distribution of the superconducting gap within single Fermi sheets, setting aside the proposed scenario of a two-gap superconductivity. Our results point to a spatially localized competition between superconductivity and CDW involving the HC regions of the crystal.