A longtime city mediation lawyer claims he’s been repeatedly passed over for promotion because he’s a white man.

Raymond Karlin, 62, said he’s missed out on seven promotions since joining the city’s Commission on Human Rights in 1995, while five women and a transgender person got higher-paying gigs.

Those promoted over Karlin had “substantially less” experience than he does, he charges in his Manhattan Supreme Court lawsuit.

Karlin, who earns more than $115,000 with contractual longevity pay raises, is seeking a promotion to “an appropriate position,” along with unspecified damages.

“If the genders in this case were reversed, and men were obviously favored in the same way by male leadership, the City never would have tolerated it. Discrimination against men is no less unlawful,” Karlin’s lawyer, Steven Warshawsky, told The Post.

A Law Department spokesman said the city is reviewing the claim, adding the commission is committed to “equality and fairness for all New Yorkers, including city employees.”