Rebecca Kaplan, the ebullient, left-leaning Stanford Law School alumna who since 2009 has held Oakland City Council’s at-large seat, is facing a formidable challenger.

The candidate with the best chance of unseating Kaplan in November, Peggy Moore, is a former senior special adviser to Mayor Libby Schaaf who helped run political campaigns for President Obama and Democratic presidential nominee Hillary Clinton. Like Kaplan, Moore is an outspoken lesbian with solid ties in Oakland City Hall and a history of community service.

The two women used to be allies. They worked side by side in 2000 to try to defeat a state ballot proposition that invalidated same-sex marriages. Voters passed the measure, which was later struck down by the courts. Kaplan helped Moore in an unsuccessful 2005 bid for City Council, and Moore said she supported Kaplan in the 2010 mayoral race, which Jean Quan won.

“She’s a lesbian, I’m a lesbian — we’d see each other on the campaign trail, and it would be like, ‘What’s up, how you doing?’ You know, lesbian bonding,” Moore said.

Now they are locked in a bitter battle that at times seems wrenchingly personal. Kaplan, who frequently butts heads with Schaaf, sees Moore’s campaign as a calculated attack from the mayor.

Moore “clearly has a campaign that’s staffed by, run by, funded almost entirely by the mayor’s people,” Kaplan said, her voice rising. “Whether that was the intention that was in Peggy’s heart, I don’t know.”

A spokeswoman for Moore’s campaign said Moore and Schaaf share “a common vision” for Oakland and that many of the coalitions that backed Schaaf in the mayor’s race have also thrown their support behind Moore.

But Moore, who was Schaaf’s campaign manager, says the decision to run this year was hers alone, not Schaaf’s.

“It’s been in the back of my mind forever,” she told The Chronicle during an interview in her campaign office on Oakland’s Auto Row.

If elected, she said she will try to bring peace to a leadership body known for squabbling.

“I’m a community organizer. I’ve been doing this for 25 years,” Moore said a recent candidates forum in Rockridge hosted by the League of Women Voters. “I have relationships that are statewide and national, and I think you need to have some folks to bring in new innovation, ways of thinking, and access to more stuff for our city.”

Kaplan has said she will focus on tenants’ rights, funding for new transportation projects, passing a citywide soda tax and recruiting more women and openly gay officers into Oakland’s police force. She is currently pushing a city ballot measure to protect renters from eviction, and to require property owners to petition for certain rent increases.

Of Moore, she said, “We were close friends for years before she launched her career of campaigning against me.”

The at-large seat holds particular allure for anyone with higher political ambitions, said Oakland political consultant Jim Ross, who helped run Kaplan’s unsuccessful 2010 mayoral campaign.

“You get to build a citywide presence,” Ross said. “You can work on a fire issue in the hills, or an economic inequality issue in the flats. And then if you run for higher office — state Assembly, Senate or mayor — it gives you a much broader platform.”

Both Kaplan and Moore have tried for higher political posts in the past, with Kaplan bidding for mayor in 2010 and 2014, and Moore making a short-lived push for the Richmond-area state Assembly seat in 2014; she dropped out before her name got on the ballot.

Three other candidates are muscling for the at-large seat, which represents the entire city — about 400,000 constituents — rather than homing in on the needs of a single district. Nancy Sidebotham, a board member of the Metropolitan Greater Oakland Democratic Club, has pledged to bring “a community voice to City Hall.” Matt Hummel, chair of the city’s Cannabis Regulatory Commission, has promised to use community leaders as advisers, rather than lobbyists. Bruce Quan, a longtime friend of former Mayor Quan (no relation) has pledged to give everyone in Oakland equal access to education, housing and employment opportunities.

Yet all eyes are on the top two contenders.

“I know Rebecca is running an aggressive campaign, which makes sense because Peggy is a real challenger, and she has real support from the mayor,” Ross said. He argues that Moore, despite her political connections, will have a hard time unseating a well-liked incumbent.

“Usually a challenger has to raise more money, and also run as much of a mistake-free campaign as possible,” he said.

In August, Moore’s campaign made an embarrassing mistake.

The candidate’s hired polling firm, EMC Research Inc., emailed a poll to Oakland voters, falsely stating that Moore had support from Rep. Barbara Lee and Assemblyman Tony Thurmond, D-Richmond. Days later, Lee’s office sent the first of two statements to media outlets, saying the congresswoman had not endorsed Moore or any other Oakland City Council candidate.

Moore said she was unaware of the gaffe until an audience member buttonholed her during a recent candidate’s forum.

“When it came to my attention I called EMC immediately. They made an adjustment,” she said. On Aug. 30, the company sent out a correction, saying that Lee and Thurmond had not “yet” endorsed anyone in the at-large race.

Moore has tried to put the incident behind her. Kaplan won’t let it go.

“She’s saying, ‘Oh no, I’m not running out of some sleazy attack on Kaplan, I’m running because I really want it for myself,’” Kaplan said. “Well then, why are you having the people you paid to do your campaign work launch your campaign with a sleazy attack on me?”

Yet some political insiders say that Kaplan will only sabotage herself by framing Moore as the mayor’s proxy.

“I think the last thing (Kaplan) wants to do is turn this into a ‘Rebecca vs. Libby’ race,” said San Francisco State University Professor Joe Tuman, who ran unsuccessfully for Oakland mayor in 2010 and 2014. “Because that’s a race she’s going to lose.”

Rachel Swan is a San Francisco Chronicle staff writer. Email: rswan@sfchronicle.com Twitter: @rachelswan