Suzanne Lee has been pounding the sun-kissed pavement of South Boston, trying to finish what she started two years ago: unseating Bill Linehan, the city councilor who has represented District 2 since 2007.

“I never give up,’’ said Lee, a Chinatown activist who lost by just 97 votes to Linehan in the 2011 race. “I’m very persistent.”

Meanwhile, on South Boston’s tony waterfront one evening, Linehan worked a roomful of women hosting a ladies’ night in his honor. Since his close win in 2011, Linehan has been vocal about his accomplishments on the council and the fact that he is not ready to quit. As he grabbed the microphone, a hit song blared by the 1960s group, The Marvelettes.

The title and refrain: “Don’t Mess with Bill.”

Jim Davis/Globe Staff

Incumbent City Councilor Bill Linehan said he has learned from the previous campaign and is not ready to quit.

In what is shaping up as a hotly contested rematch in the Nov. 5 election, Linehan, the incumbent South Boston councilor and a former parks department official, and Lee, a former school principal, are fighting for the heart and soul of District 2, a broad swath of the city that includes parts of Beacon Hill, downtown, the South End, and all of Bay Village, Chinatown, and South Boston.

Along the winding roadways and narrow lawn patches of the district, residents in drastically different neighborhoods are experiencing similar effects of new development and shifting demographics. They have clamored for quality schools, improved public safety, and a broader say in the vision for their communities.

The last time these candidates faced off, Lee stunned Linehan with victories in every neighborhood in the district except South Boston, where Linehan trounced her by getting more than twice as many votes. After a recount, Linehan, who has served three two-year terms on the council, won with 5,078 votes to Lee’s 4,981.

Lee’s loss was bittersweet in Chinatown, where Lee has become a symbol of the community’s new-found political clout, advocates said.

“Even though she lost . . . it still felt like a victory,’’ said Lydia Lowe, executive director of the advocacy group Chinese Progressive Political Action. “For a first-time candidate from the smallest community in the city to almost beat an incumbent from South Boston was almost unbelievable.”

Jessica Rinaldi for The Boston Globe

Chinatown activist Suzanne Lee is a former principal who lost the 2011 race by just 97 votes.

With about two weeks left before voters head to the polls, both candidates say they have learned hard lessons from that earlier race and are tweaking their campaigns. Targeting her weakest spot, Lee has been in South Boston daily. She has been handing out fliers, knocking on doors, and talking to as many people as possible.

“Hi, I’m Suzanne,’’ she said one day outside of Stop & Shop on East Broadway, just steps away from Linehan’s campaign office. “Have you heard of me?”

People recognize her, some remember her name from the previous race, and others who voted for her vow to check her name on the ballot.

“She’s been in Southie canvassing every day,’’ said Joanne McDevitt, a longtime South Boston resident who voted for Lee the last time around and is now a campaign volunteer.

Lee, who was born in China, grew up in Grove Hall. She said running for political office is a natural extension of her work as a former teacher and principal who turned around a failing Boston school, and as an activist in Chinatown, where she organized garment workers, fought for a bilingual ballot, and rallied immigrants and residents around issues such as public safety and affordable housing.

Lee lived in Brookline for two decades and moved to Chinatown three years ago. She said she wants to break down walls that divide neighborhoods in the district, improve transparency on the council, and bring people together around common goals.

“No matter where you live in the district, we face the same issues,’’ she said.

The path to victory must include South Boston, where Linehan has spent his entire 62 years with his large family. His roots in the community run deep.

Some residents said they want a change. Sheila Green, a longtime City Point resident in South Boston, said that of the two candidates, Lee can best address what she describes as “development gone awry” in her neighborhood.

“Bill Linehan seems like a nice guy,’’ said Green. “I don’t have anything against him, but he’s ineffective.”

But Linehan’s supporters, stunned by the close race two years ago, are galvanizing around him.

Jim Davis/Globe Staff

City Councilor Bill Linehan grew up in housing developments in South Boston, where he has spent his entire 62 years with his large family.

“He’s been out there working hard,’’ said Linehan’s neighbor Mary Whelen, a 79-year-old South Boston resident. “It’s like he’s trying to make up for what happened.”

Sharon Butler, a public school teacher and a staunch Linehan supporter, chided Lee for having lived in Brookline and sending her son to schools there.

“I don’t really know that much about her. . . . You raise your kid there and you come here?’’ Butler said. “How much does she know about this community?”

Linehan grew up in Southie’s housing developments. He worked as a garbage collector before he got a job in the Boston Parks & Recreation Department, where he rose to become director of operations, and later an aide to the mayor. He said that in the past two years he has been focused on championing his accomplishments during his 25 years in city government, such as pushing for a transportation master plan for the waterfront, establishing a dedicated police drug unit for the district, and fighting to expand and retain library services in the area.

Linehan said that he has learned from the previous campaign against Lee that she is a formidable opponent and that he has been targeting areas in which he did poorly such as Bay Village and the South End.

“When you win by a small majority, you realize that every vote is important, not that I underestimated that,’’ said Linehan. “But it hits home. I was grateful that I won. I was grateful that I can keep doing this work.”

But Linehan’s tenure has been tinged with controversy. He came under fire shortly after the 2011 election when community activists accused him of proposing a redistricting map that divided Chinatown and shifted precincts where Lee badly beat Linehan to two other districts.

The council eventually adopted a revised map after much public input.

Last month he was in the center of a media storm over his assertion that the host of the St. Patrick’s Day breakfast should remain an elected official from South Boston. The event has been long hosted by the state senator from the First Suffolk District, which for decades was a candidate from South Boston. But a black woman from Dorchester, Linda Dorcena Forry, won the seat earlier this year, and a number of South Boston politicos claimed the post belonged to the ranking elected official from the neighborhood.

The standoff ended quickly after an avalanche of political pressure, and Linehan, who had been acting host after Jack Hart resigned, agreed to stand down.

Linehan said he had always intended on meeting with Dorcena Forry and having a conversation about hosting the event. But all that is behind them now, and the two are continuing to work for the betterment of the district, he said.

Standing in a roomful of women at Empire Restaurant and Lounge one evening, Linehan doled out kisses and jokes as supporters showered him with hugs. Grabbing the microphone, he spoke of the importance of voting in the upcoming election, when a new mayor and at least four new city councilors will be elected.