The city’s top official on health and homelessness quit because she was tired of being ignored by a mayor more interested in boosting his national profile than attending to the city’s day-to-day concerns, sources said.

Deputy Mayor Lilliam Barrios-Paoli worked for five mayors and oversaw seven city agencies under Mayor de Blasio — but she couldn’t get meetings with him, sources said.

Frustrated by her declining ­access and inability to get initiatives green-lighted, the 70-year-old former nun announced her resignation on Aug. 31, shocking the advocacy community.

“She was fed up,” a City Hall source said. “She wasn’t able to do her job.”

As the exploding homeless problem began capturing headlines over the summer, Barrios-Paoli said, “I told you so. If you’re not going to listen to anything I say, I’m out,” according to the source.

The source added, “The mayor is so focused on national issues, he has not taken time to focus on ­local issues.”

It’s a complaint that is growing louder, even among de Blasio’s fellow Democrats, who uncharacteristically and publicly ripped the administration recently for its ­absentee governing.

Bronx Assemblywoman Carmen Arroyo lambasted Schools Chancellor Carmen Fariña for being disrespectful and unresponsive.

“I cannot work with you,” the lawmaker fumed during an Albany hearing on Oct. 14. “I make a call to your office and nobody answers me.”

Brooklyn Borough President Eric Adams slammed Hizzoner the next day for failing to send reps to the BP’s charter-mandated meetings.

“I will be calling the mayor. I will be speaking to City Hall about those people who are not here,” Adams said. “Reps should be here . . . to report on what their agency is doing in the borough of Brooklyn.”

Barrios-Paoli oversaw the departments of Health and Homeless Services but had far fewer meetings with the mayor than other top officials, according to 17 months of private mayoral schedules examined by The Post.

She sat in on meetings with the mayor and senior staff 23 times in the first five months of 2015. By comparison, Deputy Mayor Alicia Glen, in charge of housing and economic development, convened with de Blasio 98 times, and Budget Director Dean Fuleihan met with Hizzoner 109 times.

The schedules also show that Barrios-Paoli’s face time with de Blasio sharply declined over time. In the first five months of 2014, she attended 76 group meetings with the mayor — 70 percent more than in the same period this year.

And Barrios-Paoli had only two one-on-one meetings with de Blasio between January and May 2015 — lasting a total of 55 minutes.

First Deputy Mayor Anthony Shorris was “calling more of those shots than Barrios on health and social services,” a political source said. “It’s very insular. They only let so many people be involved in planning and decision making.”

Barrios-Paoli and Glen clashed over how to curb homelessness as the population surged 10 percent during the mayor’s first year in ­office. Barrios-Paoli wanted more space in public housing reserved for homeless people; Glen didn’t.

“She didn’t have face time with the mayor because homelessness wasn’t a priority for him even though it has become more and more important to the city,” said the City Hall source. “It’s bizarre.”

Barrios-Paoli is now serving as the Health and Hospitals Corp. board chairwoman, an unpaid, part-time position.

She told The Post she left City Hall to “pursue other interests.”

“Any other theories are only speculation,” she added.

City Hall has not filled Barrios-Paoli’s position.

“Shorris is pissed,” one political source said. “He’s getting all the health work she had. He’s annoyed she left, and he’s drowning in it.”

“Mayor de Blasio is extremely grateful to Deputy Mayor Barrios-Paoli for her service,” said mayoral spokeswoman Karen Hinton.

“When she decided to resign, the Mayor described her as an extraordinary public servant who will be sorely missed. Her work improved the lives of thousands of New Yorkers, and the Mayor looks forward to a continued collaboration with her at HHC.”