City Comptroller Scott Stringer is leading all contenders in raising campaign cash for the 2021 mayoral race, but Council Speaker Corey Johnson and Brooklyn Borough President Eric Adams have gained serious steam over the past six months.

Stringer raised $313,087 from Jan. 12 through July 11 — leaving him with $2.59 million cash on hand, according to campaign disclosure records made public Monday.

Adams raised $583,627 over the past six months, leaving him with $2.28 million in his political war chest.

Johnson raised $379,518 over the same period after pledging in late January that he wouldn’t accept donations over $250.

He also vowed to reject special interest money from political action committees, persons employed by lobbying firms and real estate developers and their employees.

However, at least one such donation made its way into his campaign coffers.

Mamie Chiang, a vice president for developer Gordon Lau’s company Lau Management, gave Johnson $250, records show.

Johnson’s campaign said it plans to return the cash after being asked about it by The Post.

“No one has ever done anything like this before — a grassroots campaign for citywide office that accepts no contributions from real estate developers, people who work at lobbying firms, and corporate PACs,” said Mathew Bergman, Johnson’s campaign treasurer. “We tried to vet every one of over 3,000 donations, but it appears someone slipped through.”

Besides the Chiang donation, Johnson appears to be sticking to his campaign pledge — even if he’s walking a fine line.

At least three $250 donations were from registered lobbyists who don’t actually work for a lobbying firm.

For instance, Carly Garcia, the in-house lobbyist for Google — which does city business — was among the 12 company employees who combined to donate $2,150 to Johnson.

Moreover, more than $8,000 in other donations were from employees of real estate brokerage firms or management companies.

The construction industry was also generous — especially Commodore Construction, which has city contracts and had 10 of its employees give Johnson $250 each.

Both Stringer and Johnson are expected to take advantage of a new public matching fund system that pays candidates an 8-to-1 match for the first $250 raised from a donor.

Stringer estimates being in line to have $4.75 million in campaign funds when including matching claims, while Johnson anticipates his current $431,549 will skyrocket to $2.9 million after taking advantage of the new matching fund rules.

The speaker’s average contributor donated $144, and all 2,616 donations received were $250 or under.

Other candidates expected to run for mayor include Bronx Borough President Ruben Diaz Jr., who had yet to submit his latest campaign filings as of 7 p.m. Monday but had $793,104 on hand as of January.