First lady Chirlane McCray has raised between $13 million and $28 million in donations for a City Hall-aligned nonprofit from people and entities with business before her hubby Mayor de Blasio, The Post found.

The Mayor’s Fund to Advance New York City raised the cash during McCray’s four-year tenure as chairwoman from big Wall Street banks, developers, lobbyists, nonprofits and others. The Post analyzed donations made between April 2014 and September 2017 found in disclosures filed with the city Conflicts of Interest Board, along with data from the Mayor’s Office of Contract Services.

In January 2014 de Blasio got approval from COIB to appoint his wife chair of the Mayor’s Fund. As chairwoman, McCray is the “lead fund-raiser” for the fund, which was created in 1994 under former Mayor Giuliani to promote City Hall’s agenda.

Conflict of interest rules bar civil servants from fundraising on the city’s behalf from people with business before their agencies unless “firewalls” exist between those officials and decisions that could impact the donors.

But because McCray is an unpaid volunteer and not a city employee, the rule doesn’t apply to her — even though the mayor often calls her his “closest confidante” and “No. 1 adviser.”

In fact, in her “unofficial” City Hall role, McCray has a full-time staff of five, oversees the administration’s $850 million mental health program, interviews job candidates, sits in on staff meetings, takes solo trips outside the city billed to taxpayers and advises de Blasio on everything from policy to media strategy. She’s also being positioned as a potential candidate for public office.

As boss of the mayor’s fund, McCray has the freedom to not only fundraise from anyone with business before the city, but discuss the donors or issues and policies impacting them with her husband.

“It’s a perfect example for why we believe the Mayor’s Fund shouldn’t exist, period,” said Susan Lerner, executive director of Common Cause New York. “It is subject to at worst abuse and at minimum an appearance of impropriety.”

The de Blasio administration has already come under fire for alleged pay-to-play outside the Mayor’s Fund, dodging charges following separate investigations into his now defunct political nonprofit, the Campaign for One New York, and other fundraising efforts.

Yet the Mayor’s Fund targets many of the same donors.

“It occurred to me that we were approaching people for fundraising who had just been called for the Campaign for One New York,” said a source familiar with the operation. “There was never really much discussion around that.”

In the Mayor’s Fund disclosures, where amounts are given in ranges and not exact figures, The Post found between $12.87 million and $27.81 million from donors with business before the city.

They included:

Prominent developer Tishman Speyer, which donated between $975,000 and $2.01 million.

The powerful Real Estate Board of New York, chaired by Tishman Speyer CEO Rob Speyer, which gifted $255,000 to $519,998.

Rudin Management Co., whose CEO and co-chair Bill Rudin was phoned by McCray, gave between $40,000 and $119,998. Other Rudin-linked foundations put up between $250,000 and $629,992.

Lobbying firm Capalino+Company donated between $10,000 and $39,998. The firm has become one of the most profitable in the city since de Blasio was elected, taking in nearly $46 million from 2014 to 2017.

Big donors Goldman Sachs, Citi and JPMorgan have been doing business with the city for years, earning millions from work for the pension funds. Groups backed by them have given the Mayor’s Fund between $4.95 million and $8.25 million.

The extent of conflicted donations to the Mayor’s Fund outraged good-government groups.

“When real estate and banking interests give hundreds of thousands of dollars to the mayor’s nonprofit chaired by his wife while having business before the city, it looks to the public like an effort to gain access, curry favor, and make an end run around the city’s campaign finance restrictions,” said Alex Camarda, a senior policy advisor at Reinvent Albany.

Rudin, Tishman Speyer, Goldman Sachs, REBNY and the Gray Foundation lauded the work of the Mayor’s Fund to help hurricane recovery, low-income kids and more, but they didn’t speak to the potential for conflicts. Other donors did not comment.

“The City’s independent ethics board approved the First Lady’s appointment to a position in which she has helped provide thousands of internships to vulnerable youth and connected countless New Yorkers to mental health resources,” said City Hall spokeswoman Jane Meyer. “Under her leadership, the Fund will continue to be a force for civic good.”