To investigate the mechanism of action of Banxia-Shengjiang drug pair on the inhibition of gastric cancer (GC) using network pharmacology and bioinformatics techniques. The action targets of the Banxia (Pinellia ternata (Thunb.) Makino) -Shengjiang (Zingiber officinale Roscoe) drug pair obtained from the TCMSP database were intersected with differentially expressed genes (DEGs) and GC-related genes, and the intersected genes were analyzed for pathway enrichment to identify the signaling pathways and core target genes. Subsequently, the core target genes were analyzed for clinical relevance gene mutation analysis, methylation analysis, immune infiltration analysis and immune cell analysis. Finally, by constructing the PPI network of hub genes and corresponding active ingredients, the key active ingredients of the Banxia-Shengjiang drug pair were screened for molecular docking with the hub genes. In this study, a total of 557 target genes of Banxia-Shengjiang pairs, 7754 GC-related genes and 1799 DEGs in GC were screened. Five hub genes were screened, which were PTGS2, MMP9, PPARG, MMP2, and CXCR4. The pathway enrichment analyses showed that the intersecting genes were associated with RAS/MAPK signaling pathway. In addition, the clinical correlation analysis showed that hub genes were differentially expressed in GC and was closely associated with immune infiltration and immunotherapy. The results of single nucleotide variation (SNV) and copy number variation (CNV) indicated that mutations in the hub genes were associated with the survival of gastric cancer patients. Finally, the PPI network and molecular docking results showed that PTGS2 and MMP9 were potentially important targets for the inhibition of GC by Banxia-Shengjiang drug pair, while cavidine was an important active ingredient for the inhibition of GC by Banxia-Shengjiang drug pair. Banxia-Shengjiang drug pair may regulate the immune function and inhibit GC by modulating the expression of core target genes such as RAS/MAPK signaling pathway, PTGS2 and MMP9.