African swine fever virus (ASFV), the etiological agent of African swine fever (ASF), causes deadly hemorrhagic fever in domestic pigs. ASF's high mortality and morbidity have had disastrous effects on the world's swine industry. In recent years, the number of African swine virus strains has increased and presented new challenges for detecting classical ASFV-p72-based viruses. In this study, we observed that the ASFV MGF505-7R gene, a member of the multigene family that can enhance ASFV virulence and pathogenesis, has the potential to be a candidate for vaccine formulations. We also developed a real-time PCR assay based on the ASFV MGF505-7R gene and validated it in multiple aspects. The results indicated that the approach could detect standard plasmids with a sensitivity and a specificity of up to 1 × 101copies/μL. Moreover, the assay had no cross-reactions with other porcine viruses. In laboratory and clinical settings, the assay can detect ASFV-infected samples at an early stage (4 hpi) and show a consistency of 92.56% when compared with classical ASFV detection in clinically ASFV-infected materials. This study's results also indicated that the TaqMan-based quantitative real-time PCR assay we developed for detecting the ASFV MGF505-7R gene is both sensitive and specific. This assay can provide a quick and accurate method for detecting ASFV and has the potential to be used as an optional tool for screening and monitoring ASF outbreaks.