Forest gaps induce environmental heterogeneity, but their effects on the local forest floor microbial communities are not fully understood. This research investigated the impact of forest gap positions on the forest floor microbial community composition to provide baseline information for projects to accelerate nutrient cycling and forest regeneration and enhance ecosystem services. A one-year-old forest gap and an area of 40–50 m2 in Pinus tabulaeformis plantations were selected in the Beijing mountainous area. Forest floor samples were collected from the following positions: gap center, gap border, and adjacent closed canopy. Our study demonstrated that gap positions significantly influenced the forest floor microbial community composition. The Gram-positive bacteria, Gram-negative bacteria, and total bacteria, as well as the fungi, were significantly greater in the forest gap center and gap border compared to those in the closed canopy, and the dissolved organic carbon, readily oxidized organic carbon, ammonia nitrogen, and nitrate nitrogen followed the same trend. Compared with those of the closed canopy, the Gram-positive bacteria, Gram-negative bacteria, total bacteria, and fungi in the gap center were markedly greater by 23%, 25%, 22%, and 24% and by 14%, 14%, 11%, and 16% in the gap border, respectively (p < 0.05). Redundancy analysis demonstrated that shifts in the litter microbial community composition were predominantly predicted by litter moisture and β-1,4-glucosidase. In addition, we discovered that the microbial community composition was greater in the undecomposed forest layer than that in the semi-decomposed layer. In summary, gap positions and forest floor layers have a significant impact on microbial community composition. Nevertheless, additional long-term investigations are needed. Our study provides a reference for the promotion of nutrient cycling to guide future ecological management.