Gastrointestinal cancers have become an important cause of cancer-related death in humans. Improving the early diagnosis rate of gastrointestinal tumors and improving the effect of surgical treatment can significantly improve the survival rate of patients. The conventional diagnostic method is high-definition white-light endoscopy, which often leads to missed diagnosis. For surgical treatment, intraoperative tumor localization and post-operative anastomotic state evaluation play important roles in the effect of surgical treatment. As a new imaging method, near-infrared fluorescence imaging (NIRFI) has its unique advantages in the diagnosis and auxiliary surgical treatment of gastrointestinal tumors due to its high sensitivity and the ability to image deep tissues. In this review, we focus on the latest advances of NIRFI technology applied in early diagnosis of gastrointestinal tumors, identification of tumor margins, identification of lymph nodes, and assessment of anastomotic leakage. In addition, we summarize the advances of NIRFI systems such as macro imaging and micro imaging systems, and also clearly describe the application process of NIRFI from system to clinical application, and look into the prospect of NIRFI applied in the theranostics of gastrointestinal tumors.