Gramine is a natural indole alkaloid with a wide range of biological activities, but its anti-gastric cancer activity is poor. Herein, a pharmacophore fusion strategy was adopted to design and synthesize a new series of indole-azole hybrids on the structural basis of gramine. Based on our previous studies, different nitrogen-containing five-membered heterocyclic rings and terminal alkyne group were introduced into the indole-based scaffold to investigate their effect on improving the anti-gastric cancer activity of gramine derivatives. Structure-activity relationship (SAR) studies highlighted the role played by terminal alkyne in enhancing the inhibitory effect, and compound 16h displayed the best antiproliferative activity against gastric cancer MGC803 cells with IC50 value of 3.74 μM. Further investigations displayed compound 16h could induce mitochondria-mediated apoptosis, and caused cell cycle arrest at G2/M phase. Besides, compound 16h could inhibit the metastasis ability of MGC803 cells. Our studies may provide a new strategy for structural optimization of gramine to enhance anti-gastric cancer activity, and provide a potential candidate for the treatment of gastric cancer.