Abstract: Gastric cancer was the fifth most common cancer, and its drug treatment mainly included chemotherapy, targeted therapy, and immunotherapy. With the rise of immunotherapy in gastric cancer, small-molecule anti-gastric cancer drugs still have irreplaceable places because of many advantages, such as high stability and mass-productivity, high efficiency, and low cost. At present, the small-molecule anti-gastric cancer drugs in the clinic are constrained by their side effects. So, developing more novel anti-gastric cancer drugs with better efficacy and fewer side effects is urgently needed. Nitrogen-containing heterocycle molecules have attracted much attention from researchers due to their high biocompatibility, activity, and bioavailability, and they even could act with a unique mechanism. This review summarized various types of nitrogen-containing heterocycle antigastric cancer lead compounds from 2017 to 2022 in the last five years. Compared with monocyclic nitrogen-containing heterocycle and bicyclic nitrogen-containing heterocycle, the thick nitrogen-containing heterocycle applied as the skeleton not only showed high efficiency and low toxicity but also, interestingly, may have had some unique mechanism such as inhibition of aurora A and B kinases, etc. We propose two prospective and valuable strategies to develop more efficient candidates for anti-gastric cancer. One strategy was further optimized for some lead compounds mentioned in this review. The other strategy involved utilizing the "pseudo-natural products" concept proposed by Professor Wilhelm Waldmann, combining different nitrogen-containing heterocycle fragments in two and three-dimensional spaces to obtain new thick nitrogen-containing heterocycle skeletons. The strategy will contribute to the expansion of the thick nitrogenous heterocycle’s framework, and it was expected that more novel mechanisms and more effective antigastric drugs could be found. These two strategies are expected to help researchers develop more anti-gastric cancer drugs with better potency and lower side effects.