Light sources are crucial for photoelectrochemical (PEC) self-powered sensing, where visible light is widely used. However, due to its high energy, it has some downsides as an irradiation source for overall system, so it is urgent to achieve effective near-infrared (NIR) light absorption because it makes up a significant portion of the solar spectrum. Herein, up-conversion nanoparticles (UCNPs) that could increase the energy of low-energy radiation were combined with semiconductor CdS as the photoactive material (UCNPs/CdS), which broadens the response range of solar spectrum. The NIR light-excited self-powered sensor could be produced via oxidizing H2O at photoanode and lowering dissolved oxygen at cathode under the NIR light without external voltage. Meanwhile, molecularly imprinted polymer (MIP) was added to photoanode as a recognition element to increase the sensor's selectivity. The open-circuit voltage of the self-powered sensor grew linearly as chlorpyrifos concentration climbed from 0.01 to 100 ng mL-1, showing good selectivity as well as reproducibility. This work provides valuable basis for the preparation of efficient and practical PEC sensor with NIR light response.