The content of Cytokeratin-19 fragments (CYFRA21–1) is correlated with the metastasis and survival status of patients with lung cancer, and the expression level is higher in the serum of nearly half of non-small cell lung cancer patients. Using CYFRA21–1 as the detection target, a sandwiched photoelectrochemical (PEC) immunosensor based on CdS/Ni(OH)2 was designed and constructed successfully. Herein, due to the matched energy band structure, the Ni(OH)2 modified CdS nanorods made up for the shortcomings of CdS photogenerated electrons and holes that were easy to recombine quickly. In addition, the Z-type heterojunction composite material CdSe@MoSe2 was used as a label to improve the sensitivity of the sensor. On the one hand, MoSe2, with excellent resistance to light corrosion, could absorb and utilize near-infrared light due to its narrow band gap, which expanded the light source available for the sensor. On the other hand, the photo-generated charge on CdSe@MoSe2 would be transferred to the CdS/Ni(OH)2, thereby enhancing the photocurrent of the sensor. The detection limit of this sensor was as low as 0.027 pg mL−1 due to the above advantages, and the sensor’s detection range was from 0.100 pg mL−1 to 500 ng mL−1. Additionally, the sensor showed good stability, selectivity and reproducibility, which provided a feasible method for the detection of such tumor markers.