A photocatalytic sulfamoylation/5-endo-trig cyclization of (E)-N'-arylidene-N-phenylmethacrylohydrazides with sulfamoyl chlorides was developed. The chemoselective intramolecular addition of the carbon-centered radical intermediate to the CN bond in the hydrazone motif gave the sulfamoylated pyrazolin-5-one. Besides, sulfonyl chlorides are also suitable reaction partners to access sulfonylated pyrazolin-5-ones. This approach is characterized by mild reaction conditions, broad substrates scope, excellent selectivity and the late-stage modification of drug molecules.