Detecting cancer at an early stage is a significant challenge because of its diverse forms and elusive nature. To overcome these challenges, this research examines the hypothesis that an innovative SWCNT spectral fingerprinting approach can enhance the in vitro detection of breast cancers more efficiently than conventional methods. The spectral fingerprinting technique utilizes near-infrared (NIR) fluorescence spectra of DNA-functionalized single-walled carbon nanotubes (SWCNTs) within cellular environments, in conjunction with a machine learning algorithm, to distinguish between cancerous and healthy cells. The NIR fluorescence spectra of SWCNTs within different cell-line types showed significant differences, in terms of emission peak intensities, center wavelengths, and peak intensity ratios, due to the variations in cellular uptake and biomolecular interactions. These features served as distinguishing markers for the detection of cancer cells. A support vector machine (SVM) model trained on SWCNT fluorescence data was used to classify cancerous and non-cancerous cells. Moreover, by using Raman microscopy, we statistically analyzed the uptake of SWCNTs in both cancerous and healthy cells. Insights from this research enhance the development of nanomaterial-based platforms for biosensing and provide potential for real-time monitoring of in vivo cellular differentiation.