In the days after Eric Adams was elected mayor of New York, several of his supporters approached him with some uncomfortable advice.

They urged him not to hire his closest ally, Ingrid P. Lewis-Martin, for his administration, according to six people with knowledge of the conversations.

It was an audacious suggestion. Mr. Adams and Ms. Lewis-Martin had been friends for nearly 40 years, and she had called herself “his sister ordained by God.” She is in many ways his political alter ego: an old-school, conservative Democrat from Brooklyn who echoes many of his beliefs and quirks and shares his personality-driven approach.

But the group of supporters argued that Ms. Lewis-Martin could cause trouble at City Hall, according to the people, who spoke on the condition of anonymity to discuss private conversations. They noted that when Mr. Adams was Brooklyn borough president and Ms. Lewis-Martin was his deputy, she had alienated staff members and pushed the limits of ethics rules.

Mr. Adams rejected the guidance.

A year and a half later, Ms. Lewis-Martin, 62, has staked out a role unlike that of any other official in recent administrations. As the chief adviser, she does not have a title like deputy mayor or chief of staff, but colleagues say she has more power than anyone but Mr. Adams. She is apprised of everything in the administration, and she speaks with the weight of the mayor, even when asking for things he has not requested.

Her role highlights the mayor’s reliance on a small cadre of trusted advisers, a fact driven home last week with the resignation of the New York Police Department commissioner, Keechant Sewell. Many saw her exit as part of a pattern of officials who have left the administration over frustrations with being undermined by the mayor’s tight inner circle.

Ms. Lewis-Martin’s penchant for overriding other officials on even minor issues has angered colleagues and helped create a divided City Hall, where she is bitter rivals with Mr. Adams’s first deputy mayor, Sheena Wright, aides said.

The chief adviser has had a role in some of the mayor’s most scrutinized moves, including hiring three men to City Hall posts who were accused of holding homophobic views, dismissing the separation of church and state, and criticizing President Biden over a recent influx of migrants to New York.

Ms. Lewis-Martin’s conduct has also raised ethical concerns, including her work to boost the mayor through political action committees funded by donors with business before the city.

Many politicians rely on loyal lieutenants to guard their interests. But few enforcers operate with as much freedom as Ms. Lewis-Martin, whose fierce protection of Mr. Adams has earned her a nickname she embraces: the Lioness of City Hall. And while she has little public profile, she has taken on a larger-than-life persona in New York politics.

“She’s like the Catwoman,” said Julie Won, a City Council member from Queens, who said that she liked Ms. Lewis-Martin. “A lot of people don’t know what to make of her. Is she going to be the villain or the superhero? You don’t really know.”

This article is based on interviews with 30 people who have worked with Ms. Lewis-Martin. She sat for two interviews, although after being asked specific questions about her conduct, she switched to written responses.

“Whenever a Black woman asserts herself, because she has been marginalized and discounted, then she’s called brash and all kinds of names,” she said in a statement. “But people who know me know what I’m about, they know my work ethic, and they understand my passion for getting things done for the mayor and New Yorkers.”

The mayor’s communications director, Max Young, sent a statement praising her. “Ingrid is a velvet-clad battering ram that gets stuff done for New Yorkers,” he said.

On the night that Mr. Adams won election as mayor, Ms. Lewis-Martin was the first person whom he thanked onstage. “Started from the bottom, now we’re here,” he said, quoting a Drake song.

She said in an interview that she was offered any City Hall job she wanted, and she created the role of chief adviser for its flexibility. “I can pick and choose which weeds to be in,” she said.

Ms. Lewis-Martin grew up in a middle-class, religious household in Crown Heights, Brooklyn. She often recounts how she almost drowned at 17 and believes God saved her life.

She and Mr. Adams have said they met in 1984, through her husband, Glenn Martin, who was a friend of his in the police academy. They were all in their 20s, and they socialized together.

Even then, Ms. Lewis-Martin said, Mr. Adams harbored ambitions of becoming mayor — and she wanted to help. “We were put together at that time to do exactly what we’ve done,” she said, echoing the mayor’s claims that his election was divinely ordained.

After a few years as a teacher, Ms. Lewis-Martin was introduced to the Brooklyn Democratic Party, which dominated politics in the borough. She began working for establishment Black politicians, including Representative Major Owens and Assemblyman Roger Green. She excelled at the hardball tactics of machine politics.

“People tried to criticize her, and they thought she’d take it, and they were sadly mistaken,” said Letitia James, the state attorney general, who worked with her then. When asked what Ms. Lewis-Martin said in response to the criticism, Ms. James said: “Words you can’t print in The New York Times.”

Ms. James added that the Brooklyn Democratic machine thrived on retail politics, “and nobody does it better than Ingrid.”

In 2006, when Mr. Adams decided to run for the State Senate, he asked his old friend to serve as campaign manager. She has been a top aide ever since.

Working for Mr. Adams has been lucrative. She made nearly as much as he did at Borough Hall, and she now makes about $252,000 annually, more than any City Hall official other than the first deputy mayor. She also has earned additional money moonlighting for his campaigns.

Ms. Lewis-Martin’s family has benefited in other ways. Her son, Glenn Martin II, a professional D.J., has gotten exposure by performing at Borough Hall and Gracie Mansion, and at other events sponsored by Mr. Adams’s offices, including the Rise Up Concert Series last summer.

“Big Stage!!” he wrote on Instagram about the Rise Up concert. He tagged Mr. Adams.

Mr. Martin for years played a weekly brunch set at Woodland, a restaurant that was run by Johnny and Robert Petrosyants, brothers who are close friends of Mr. Adams and have raised money for him.

Ms. Lewis-Martin has often used her roles to personally help the Petrosyants brothers and Mr. Adams’s other supporters.

In 2016, for example, another restaurant run by the brothers, Wallabout Seafood & Co., received a water lien from the Department of Environmental Protection, and Ms. Lewis-Martin, then deputy borough president, asked her staff to contact the agency and help resolve the issue. “Please have it expedited,” she wrote, according to emails obtained by The Times.

In his statement, Mr. Young, the communications director, said Ms. Lewis-Martin did not do any special favors for the Petrosyants or anyone else but rather worked on behalf of all Brooklynites. He added that Mr. Martin was not paid for any of his performances at events sponsored by Mr. Adams.

Mr. Martin declined to comment.

Robert Petrosyants said in an interview that he did not hire Mr. Martin as a favor to Ms. Lewis-Martin, and that she did not resolve the water lien. “She didn’t do anything,” he said.

At Borough Hall, Ms. Lewis-Martin developed a reputation for discussing her faith — and threatening anyone who crossed her boss. (“I’m not Michelle Obama,” she once told City and State. “When they go low? We drill for oil.”)

Her tenure was also marked by ethics questions.

Her duties included leading a nonprofit, the One Brooklyn Fund, promoting the borough. Colleagues said that Ms. Lewis-Martin approached real estate firms and others with business at the office and asked them to donate, a possible conflict of interest.

Ethical issues have followed Ms. Lewis-Martin to City Hall.

Politico reported last month that Ms. Lewis-Martin had helped guide the Committee for a Fair New York, a PAC that supported moderate candidates for the Assembly. That raised concerns because it meant donors could be currying favor with City Hall by contributing to the PAC.

Ms. Lewis-Martin worked with another PAC last year, according to two people involved: Striving for a Better New York. That group, which also backed moderates, drew attention because it gave a lot of its money to its founder, the Rev. Alfred L. Cockfield II, and his associates. It donated $10,000 to Lee Zeldin, the Republican running against Gov. Kathy Hochul.

At the time, Mr. Adams said he had no connection to the group. But the people involved with the PAC said in interviews that Ms. Lewis-Martin had attended some events and helped choose which candidates to support.

City Hall did not comment directly about Striving for a Better New York, but it said that all employees must adhere to strict ethical guidelines and not conduct political work on city time.

Beyond the ethics questions, Ms. Lewis-Martin’s style has sometimes earned her enemies in City Hall, especially Ms. Wright, the first deputy mayor.

Ms. Wright, who headed Mr. Adams’s transition team after the election, was among those who pushed for the mayor not to hire Ms. Lewis-Martin, according to three people involved with the transition.

Recently, after Ms. Wright was named first deputy mayor, Mr. Adams gathered the two aides together and asked them to reconcile, according to three other people familiar with the meeting. But the people said the meeting ended with Ms. Lewis-Martin telling Ms. Wright to stay out of her way, adding an expletive.

Ms. Lewis-Martin and Ms. Wright both denied that account of the meeting and disputed that Ms. Wright had suggested the mayor not hire Ms. Lewis-Martin.

“Sheena and I have never had a cross word,” Ms. Lewis-Martin said, adding that they were both professionals who worked effectively together. “For sources to lie and focus on some made-up fighting, as opposed to quality work being done in our office, is an insult to women and, in particular, Black women.”

Ms. Wright said, “Ingrid and I really do work well together, and I appreciate her leadership and partnership.”

Ms. Lewis-Martin does have many supporters in the administration.

“Everybody knows she’s a fierce force of nature,” said Maria Torres-Springer, a deputy mayor. “I’ve also experienced a deeply generous, authentic part of her. She is fiercely loyal, not just to the mayor, but her colleagues.”

Ms. Torres-Springer said she had worked with Ms. Lewis-Martin on development issues, including Innovation Queens, a $2 billion project that she credited Ms. Lewis-Martin with getting over the finish line.

Supporters pointed to other accomplishments, saying Ms. Lewis-Martin had played a role in negotiating the city’s recent contract agreement with its largest municipal union and changing the rules for trash pickup to fight rats.

Other efforts have not gone as well.

Several aides said Ms. Lewis-Martin had contributed to the city’s chaotic response to the migrant crisis. She has been in charge of coordinating with the City Council, an effort the Council has criticized.

Mr. Adams has said New York is being “destroyed” by the crisis. Three city officials said Ms. Lewis-Martin has made insensitive comments in internal meetings.

One official said that Ms. Lewis-Martin had said the migrants, many of whom are coming from Central and South American countries, should stay in Mexico since they already speak Spanish.

In his statement, Mr. Young denied that Ms. Lewis-Martin had made the comment. “Ingrid, who is Afro-Latina, has been a leader of the team that has fed, clothed and cared for nearly 80,000 asylum seekers that have come to the city, and has a long career of advocating for people of all backgrounds — and any accusation of bias is absurd,” he said.

The chief adviser has caused other headaches for City Hall, including by telling members of Congress that she opposes congestion pricing, a plan to limit traffic by charging drivers a toll to enter parts of Manhattan — a policy that is a priority of the mayor. Ms. Lewis-Martin told NY1 she had not taken the subway in more than 40 years.

In another case, at an interfaith breakfast in February, Ms. Lewis-Martin, who has said she became a chaplain a few years ago to gain respect from clergy members, said the administration “doesn’t believe” in the separation of church and state.

Mr. Adams followed her to the stage and said he agreed, sparking outrage.

Ms. Lewis-Martin said in an interview that she was proud of starting that conversation.

She also confirmed she had pushed for the hiring of gay-marriage opponents like Fernando Cabrera, who landed a $227,000-a-year job in the Office of Faith-Based and Community Partnerships despite praising Uganda when it cracked down on homosexuality in 2014. Ms. Lewis-Martin noted he had apologized. City Hall said this week that Mr. Cabrera is resigning.

Allen Roskoff, a gay rights activist who has worked with the city for over 50 years, criticized Ms. Lewis-Martin. “In my many, many years dealing with city administrations, I’ve never seen someone in that kind of position have such disregard for our community,” he said.

Ms. Lewis-Martin’s dislike of progressives is well known, mirroring Mr. Adams’s own view. Several Brooklyn Democrats said she sees progressivism as a “white-led movement” that usurps power from Black people, and she has fought against ideas like bike lanes.

In February 2022, Mr. Adams’s second month in office, the city angered residents by allowing cars back onto an eight-block stretch in Brooklyn that had been reserved for pedestrians as part of the Open Streets program. Hours later, the mayor reversed the change, saying he had been unaware of the decision and that he believed the street should remain closed to car traffic.

“If someone in my office carries out an action that did not come from me of that magnitude, I’m going to make the decision instantly on how to reverse that,” he said at an unrelated news conference.

For a time, the “mystery” of what had happened captivated transit activists.

According to two people familiar with the incident, the person who had ordered the opening, overriding the transportation commissioner and the local councilwoman, was Ms. Lewis-Martin.

City Hall declined to comment on that.

Reporting was contributed by Michael Rothfeld, Emma G. Fitzsimmons and Kate Kelly. Susan Beachy contributed research.