An accretionary prism is composed mainly of ancient marine sediment scraped from a subducting oceanic plate at a convergent plate boundary. Large amounts of anaerobic groundwater and natural gas, mainly methane (CH4) and nitrogen gas (N2), are present in the deep aquifers associated with an accretionary prism, but the origins of these gases are poorly understood. Our present study revealed a regional variation in the CH4 and N2 production processes in the deep aquifers of the accretionary prism in Southwest Japan known as the Shimanto Belt. Stable carbon isotopic and microbiological analyses revealed that the CH4 is produced through nonbiological thermal decomposition of organic matter in the deep aquifer of the coastal area near the convergent plate boundary, whereas a syntrophic consortium of hydrogen (H2)-producing fermentative bacteria and H2-using methanogens contributes to the significant CH4 production observed in the deep aquifers of the middle and mountainous areas associated with the accretionary prism. Our results also suggest that N2 production through the anaerobic oxidation of organic matter by denitrifying bacteria occurs particularly in the deep aquifer of the mountainous area in which the groundwater is affected by rainfall.