Goaf water in mining areas is widely found in China’s coal mines. To clarify the hydrogeochemical characteristics of goaf water and the influence mechanism of water–rock interaction and further reveal microbial action on the formation of goaf water quality, the goaf water in the Menkeqing coal mine was taken as the object, and physical modeling was used to simulate the process of the real goaf changing from an oxygen-sufficient environment to an anoxic environment with the rise of groundwater level in this work. The experimental results showed that the water–rock interaction in the goaf was mainly the dissolution–precipitation of minerals in the rocks of the caving zone and fracture zone, cation exchange, and oxidation of pyrite in the coal layer. The primary sources of Na+ and K+ in the goaf water were the dissolution and reverse ion exchange of silicate minerals such as albite and potassium feldspar, while Ca2+ and Mg2+ mainly from the dissolution of minerals such as calcium feldspar, calcite, and chlorite. The oxidation of pyrite in coal was the main reason for the increase in SO42− concentration, the enhancement of reduction, and the decrease in pH and DO (dissolved oxygen) in the goaf water. Relative abundance of sulfate-reducing bacteria (SRB) in goaf (e.g., Desulfosporosinus, Desulfobacterium, etc.) increased gradually, inhibiting the increase in SO42− concentration in goaf water through the devulcanization of SRB. The inverse hydrogeochemical modeling was performed using PHREEQC for two stages of the simulation experiment: 0–30 days and 30–300 days. The simulation results show that the water–rock action in the formation of goaf water mainly occurred in the simulation experiment’s early stage (0–30 days), and the mineral dissolution is dominant throughout the experimental stage. The results of the study provide a theoretical reference for the prediction of highly mineralized water pollution in goaf and its prevention and control.