Brain tumors and brain metastases are among the deadliest malignancies of all human cancers, largely due to the cellular blood-brain and blood-tumor barriers that limit the delivery of imaging and therapeutic agents from the systemic circulation to tumors. Thus, improved strategies for brain tumor visualization and targeted treatment are critically needed. Here we identified and synthesized a group of near-infrared fluorescence (NIRF) heptamethine carbocyanine dyes and derivative NIRF dye-drug conjugates for effective imaging and therapeutic targeting of brain tumors of either primary or metastatic origin in mice, which is mechanistically mediated by tumor hypoxia and organic anion-transporting polypeptide genes. We also demonstrate that these dyes, when conjugated to chemotherapeutic agents such as gemcitabine, significantly restricted the growth of both intracranial glioma xenografts and prostate tumor brain metastases and prolonged survival in mice. These results show promise in the application of NIRF dyes as novel theranostic agents for the detection and treatment of brain tumors.