Clear surgical margins for solid tumor resection are essential for preventing cancer recurrence and improving overall patient survival. Complete resection of tumors is often limited by a surgeon's ability to accurately locate malignant tissues and differentiate them from healthy tissue. Therefore, techniques or imaging modalities are required that would ease the identification and resection of tumors by real-time intraoperative visualization of tumors. Although conventional imaging techniques such as positron emission tomography (PET), computed tomography (CT), magnetic resonance imaging (MRI), or radiography play an essential role in preoperative diagnostics, these cannot be utilized in intraoperative tumor detection due to their large size, high cost, long imaging time, and lack of cancer specificity. The inception of several imaging techniques has paved the way to intraoperative tumor margin detection with a high degree of sensitivity and specificity. Particularly, molecular imaging using near-infrared fluorescence (NIRF) based nanoprobes provides superior imaging quality due to high signal-to-noise ratio, deep penetration to tissues, and low autofluorescence, enabling accurate tumor resection and improved survival rates. In this review, we discuss the recent developments in imaging technologies, specifically focusing on NIRF nanoprobes that aid in highly specific intraoperative surgeries with real-time recognition of tumor margins.