The Baguamiao gold deposit is the first large deposit discovered in the West Qinling orogen in central China in the 1990 s. However, the occurrence of invisible gold in the deposit has not been reported. There is also no consensus on whether magmatic activity is involved in the gold mineralization, the style of mineralization, and the mechanism of gold precipitation. In this study, the in-situ trace elements, and chemical mapping of pyrite and pyrrhotite in the Baguamiao gold deposit were carried out for the first time. These data combined with the C-H-O isotope data of quartz, ankerite and calcite were used to determine mineralization process. In the Baguamiao gold deposit, five types of pyrite (Py0 to Py4) and pyrrhotite (Po0 to Po4) were identified, corresponding to the sedimentary-diagenetic period and four stages of mineralization (Stage I to Stage IV), respectively. From stage I to stage IV, gold mineralization in pyrite and pyrrhotite occurs as either visible or invisible crystals. The latter occurs dominantly as lattice-bound solid solutions (Au+) and is related to the content of Cu and Te. Co and Ni contents and Co/Ni ratios indicate that pyrite and pyrrhotite are magmatic-hydrothermal origin and affected by fluid-rock interaction. The change of Se and Te concentrations in pyrite and pyrrhotite indicates that oxygen fugacity (ƒO2) was increased from stage I to stage II, and then decreased during stage III and stage IV. In addition, the δ18O values of quartz, calculated δ18OH2O values of the ore-forming fluids and δ13C values range from 16.9 to 20.3 ‰, 7.7 to 12.9 ‰, and − 19.3 to + 0.2 ‰, respectively. Such isotopic signature records typical characteristics of orogenic gold deposit. The ore-forming fluid is a mixed hydrothermal solution involving metamorphic water, magmatic water, and meteoric water, and mixed with marine carbonate and sedimentary organic matter. Gold was precipitated by phase separation, fluid-rock interaction, and fluid mixing. Combined with the tectono-magmatic evolution, metamorphic deformation, and gold mineralization age of the West Qinling orogen, it can be concluded that with the closure of the Mianlue portions of the East Paleo-Tethys Ocean, the Baguamiao gold deposit was formed in the post-collisional extensional environment between the South China Block and the North China Block in the Late Triassic and is an orogenic gold deposit reference to the crustal continuum model.