As the problem of eutrophication of water bodies and nitrate pollution of surface and groundwater is becoming more and more prominent, deep denitrification of wastewater can effectively reduce the amount of nitrate nitrogen (NO3−-N) discharged into natural water bodies. To solve this problem, in this research, the autotrophic denitrifying bacteria were incorporated in an autotrophic denitrification simulator equipped with magnetic pyrite to remove NO3−-N and total nitrogen (TN) from wastewater. The purified strains were inoculated into municipal sewage. When the ratio of magnetic pyrite to quartz sand was 1:1 and the particle size of the filler was 0.5–1 mm, the removal rate of NO3−-N and TN was optimized, at 93.52% and 83.22%, respectively. Sulphate (SO42−) concentrations will level off during stable system operation, and SO42− concentrations show a positive correlation with NO3−-N and TN removal. The 16s rDNA sequencing analysis of the screened sludge showed that the main phyla in the screened and purified sludge were Epsilonbacteraeota and Proteobacteria, with an abundance of 65.83% and 26.88%, and the final enriched products were dominated by Sulfurimonas and Thiobacillus, with an abundance of 64.91% and 9.32%, respectively. The results showed that autotrophic denitrifying bacteria could be screened and purified using thiosulfate as a substrate, and that the use of magneto pyrite as an electron donor reduced most of the NO3−-N to N2, while reducing the TN content.