Hypoxia caused by photodynamic therapy (PDT) is a major hurdle to cancer treatment since it can promote recurrence and progression by activating angiogenic factors, lowering therapeutic efficacy dramatically. In this work, AZB-I-CAIX2 was developed as a carbonic anhydrase IX (CAIX)-targeting NIR photosensitizer that can overcome the challenge by utilizing a combination of CAIX knockdown and PDT. AZB-I-CAIX2 showed a specific affinity to CAIX-expressed cancer cells and enhanced photocytotoxicity compared to AZB-I-control (the molecule without acetazolamide). Moreover, selective detection and effective cell cytotoxicity of AZB-I-CAIX2 by PDT in hypoxic CAIX-expressed murine cancer cells were achieved. Essentially, AZB-I-CAIX2 could minimize tumor size in the tumor-bearing mice compared to that in the control groups. The results suggested that AZB-I-CAIX2 can improve therapeutic efficiency by preventing PDT-induced hypoxia through CAIX inhibition.