Hypoxia can aggravate tumor occurrence, development, invasion, and metastasis, and greatly inhibit the photodynamic therapy (PDT) effect. Herein, carbon nitride (CNs)‐based DNA and photosensitizer co‐delivery systems (BPSCNs) with oxygen‐producing functions are developed to address this problem. Selenide glucose (Seglu) is used as the dopant to prepare red/NIR‐active CNs (SegluCNs). The tumor‐targeting unit Bio‐PEG2000 is utilized to construct BPSCNs nanoparticles through esterification reactions. Furthermore, DNA hydrophobization is realized via mixing P53 gene with a positively charged mitochondrial‐targeted near‐infrared (NIR) emitting photosensitizer (MTTPY), which is encapsulated in non‐cationic BPSCNs for synergistic delivery. Ester bonds in BPSCNs@MTTPY‐P53 complexes can be disrupted by lipase in the liver to facilitate P53 release, upregulated P53 expression, and promoted HIF‐1α degradation in mitochondria. In addition, the oxygen produced by the complexes improved the hypoxic microenvironment of hepatocellular carcinoma (HCC), synergistically downregulated HIF‐1α expression in mitochondria, promoted mitochondrial‐derived ferroptosis and enhanced the PDT effect of the MTTPY unit. Both in vivo and in vitro experiments indicated that the transfected P53‐DNA, produced O2 and ROS by these complexes synergistically led to mitochondrial‐derived ferroptosis in hepatoma cells through the HIF‐1α/SLC7A11 pathway, and completely avoiding PDT resistance caused by hypoxia, exerting a significant therapeutic role in HCC treatment.