Gov. Andrew Cuomo stole the thunder from Mayor Bill de Blasio on Wednesday when he signed legislation guaranteeing equal pay — even as Hizzoner said in an interview that he would sign an executive order to do the same if elected president.

“I’m going to sign a law today that says it’s not just the right thing to do, it’s not just the moral thing to do, it is also the law in the state of New York. And my friends, it is now the law in the state of New York,” Cuomo said moments before the women’s soccer team was honored with a ticker-tape parade in the Canyon of Heroes.

“There is no rationale why the women should not get paid what men get paid,” he said during the signing at the Battery. “It is immoral. It is unethical. New York is going to lead the way and we say to the U.S. Soccer League, and we say to FIFA, if you don’t pay women what you pay men, then you have no business in the state of New York.”

Cuomo signed the legislation around the same time de Blasio appeared on CNN outside City Hall to say he would sign an executive order to guarantee equal pay for women and men athletes.

The mayor, a Democratic presidential candidate, said he would insist that Congress pass an amendment to the Amateur Sports Act “requiring equal pay for men and women in all of our national sports teams.”

In the event of that failing, de Blasio said he would sign an executive order “to force” the US Soccer Federation to ensure equal pay.

Hizzoner’s comments on CNN come after The Post reported Sunday there’s a gender pay gap at the top of his administration.

The first bill sponsored by state Sen. Alessandra Biaggi (D-Bronx) prohibits wage discrimination toward individuals who fall under the protected class status — like age, race, national origin — and requires employers to provide equal pay for substantially similar work.

And since the law already prohibits discrimination based on gender, the bill expands that definition.

The second bill — sponsored by state Sen. David Carlucci (D-Westchester) — bans employers from asking job applicants about salary history.