Gas-phase molecules in cometary atmospheres (comae) originate primarily from (1) outgassing by the nucleus, (2) sublimation of icy grains in the near-nucleus coma, and (3) coma (photo)chemical processes. However, the majority of cometary gases observed at radio wavelengths have yet to be mapped, so their production/release mechanisms remain uncertain. Here we present observations of six molecular species toward comet 46P/Wirtanen, obtained using the Atacama Large Millimeter/submillimeter Array during the comet’s unusually close (∼0.1 au) approach to Earth in 2018 December. Interferometric maps of HCN, CH3OH, CH3CN, H2CO, CS, and HNC were obtained at an unprecedented sky-projected spatial resolution of up to 25 km, enabling the nucleus and coma sources of these molecules to be accurately quantified. The HCN, CH3OH, and CH3CN spatial distributions are consistent with production by direct outgassing from (or very close to) the nucleus, with a significant proportion of the observed CH3OH originating from sublimation of icy grains in the near-nucleus coma (at a scale length L
p
= 36 ± 7 km). On the other hand, H2CO, CS, and HNC originate primarily from distributed coma sources (with L
p
values in the range 550–16,000 km), the identities of which remain to be established. The HCN, CH3OH, and HNC abundances in 46P are consistent with the average values previously observed in comets, whereas the H2CO, CH3CN, and CS abundances are relatively low.