It is widely believed that the quality and characteristics of Chinese strong-flavor liquor (CSFL) are closely related to the age of the pit mud; CSFL produced from older pit mud tastes better. This study aimed to investigate the alteration and interaction of prokaryotic communities across an age gradient in pit mud. Prokaryotic microbes in different-aged pit mud (1, 6, and 10 years old) were analyzed by Illumina MiSeq sequencing of the 16S rRNA gene. Analysis of the 16S rRNA gene indicated that the prokaryotic community was significantly altered with pit mud age. There was a significant increase in the genera Methanosarcina, Methanobacterium, and Aminobacterium with increased age of pit mud, while the genus Lactobacillus showed a significant decreasing trend. Network analysis demonstrated that both synergetic co-occurrence and niche competition were dominated by 68 prokaryotic genera. These genera formed 10 hubs of co-occurrence patterns, mainly under the phyla Firmicutes, Euryarchaeota, and Bacteroidetes, playing important roles on ecosystem stability of the pit mud. Environmental variables (pH, NH4+, available P, available K, and Ca2+) correlated significantly with prokaryotic community assembly. The interaction of prokaryotic communities in the pit mud ecosystem and the relationship among prokaryotic communities and environmental factors contribute to the higher quality of the pit mud in older fermentation pits.