While he was locked away in New York’s most dangerous prisons, Eddie Gibbs never imagined that he would share a stage with the governor. Now, as he walked to the dais, his hands were shaking and his mouth was dry.

He wore a gray suit, a striped tie and a pink handkerchief with custom pink-and-white Nike Air Force 1 sneakers. Scrawled on the soles in pink marker was the inmate number he had recited to correction officers every day for nearly three years.

He was on the stage with Gov. Kathy Hochul, who was set to sign into law his bill requiring prison officials to tell people who are being released from custody that they have the right to vote.

“As the first formerly incarcerated male to serve in public office in New York State,” Mr. Gibbs, 55, said as tears formed in his eyes, “this law is near and dear to my heart.”

A Democratic assemblyman in East Harlem since 2022, Mr. Gibbs has made it his mission to help people who are or were incarcerated. His advocacy and the symbolism of his journey come during a political tug of war over criminal justice reform.

In June, while giving a speech on the Assembly floor, Mr. Gibbs said he sometimes “felt like a prop” when it came to the issue.