Michael Grimm visits a Staten Island bagel shop on Wednesday. Kevin Hagen for The Wall Street Journal

Kneeling before a memorial for his son recently, Robert Ollis said he was joined by a surprise visitor: U.S. Rep. Michael Grimm.

Mr. Grimm, a Staten Island Republican, spoke with Mr. Ollis about his 24-year-old son, Staff Sgt. Michael Ollis, who died serving in Afghanistan in August 2013. Mr. Ollis said the congressman had become close with the family since the death, helping erect the memorial and praying with the couple at their home.

“Mikey has been with us through this whole thing. He held our hands and cried with us,” said Mr. Ollis, 67 years old, a Vietnam veteran who lives in Staten Island’s New Dorp section.

If Mr. Grimm’s ability to stay competitive in his bid for a third term despite a federal indictment on tax fraud has surprised some pundits, the loyalty of Staten Islanders like Mr. Ollis may explain it.

Abandoned by the national Republican Party and struggling to raise money and retain staff, Mr. Grimm is fighting to hold on to a congressional seat targeted by Democrats as a rare potential pickup. His main weapons, supporters say, are his devotion to the nuts-and-bolts constituent work described by Mr. Ollis and a no-nonsense style that feels familiar to many Staten Islanders.

Some observers said the federal indictment may be causing some to rally around Mr. Grimm.

“There is something of an anti-hero phenomenon taking place on Staten Island,” said Richard Flanagan, an associate professor of political science and global affairs at the College of Staten Island at the City University of New York. “The political culture is a bit anti-establishment and he’s seen by some as combating the establishment. It works for him.”

The district, which includes a small sliver of southern Brooklyn, is divided. It went narrowly for President Barack Obama in 2012 but for Republican Joe Lhota over Democrat Bill de Blasio last year by nearly 10 percentage points in the mayoral race. A Siena College Research Institute/NY1/Capital New York poll Sept. 16 showed Mr. Grimm was holding a lead, with 44% of the vote to his Democratic challenger Domenic Recchia ’s 40%.

Hanging over the race are charges of fraud against Mr. Grimm, who is accused by federal prosecutors of not paying taxes and hiring illegal immigrants, among other crimes, at a Manhattan restaurant he owned. Mr. Grimm has said he is innocent.

Mr. Recchia’s case is a simple one: Mr. Grimm’s legal troubles make him unfit for office.

“He’s lying to you right now,” Mr. Recchia said as he brought up the indictment at a campaign event in Brooklyn recently.

Domenic Recchia, center, receives an endorsement. Andrew Hinderaker for The Wall Street Journal

Mr. Recchia, a Brooklyn resident whose mother and three sisters live on Staten Island, said he understands the district at least as much as Mr. Grimm.

“I’m more Staten Island than Michael Grimm,” Mr. Recchia said. “I understand them...I can connect with the people of Staten Island.”

Yet, on the ground, Mr. Recchia has struggled to make inroads on Staten Island, where some voters wave off Mr. Grimm’s indictment. Instead, many shared personal stories about their congressman in interviews.

“This is the most local race in the country,” Mr. Grimm said in an interview.

Mr. Grimm says he spends much of his time battling insurance companies over flood insurance claims for his constituents and dueling with “government bureaucrats” slow to award medals or other claims to veterans in his district.

“The standard answer in the government is ‘No,’” he said.

“Our answer when the answer is no is, ‘That’s the wrong answer.’ And I will get on the phone—I spend half my day in the district office on the phone just calling different bureaucrats, and that’s what they are, and explaining to them why they need to figure out how to do this.”

Mr. Grimm, a U.S. Marine who served during the Gulf War and is a former undercover Federal Bureau of Investigation agent, has won loyalty from many constituents for his widely shared stories of driving through the flooded streets and personally helping residents trapped by superstorm Sandy.

There are stories like that of Daniela Carchidi, 32, an ultrasound technician from Midland Beach whose home was flooded in the October 2012 storm. As she and her husband huddled in their house, watching with terror as the waters rose around them, they received a phone call from someone who worked for Mr. Grimm, telling them help was on the way.

“He stayed on the phone with us for an hour,” Ms. Carchidi, a registered Republican, said of the Grimm staffer. “Nobody would have even known we were there. There would have been nobody to rescue us.”

Of the indictment, Ms. Carchidi said: “Everyone makes mistakes.”

Mr. Grimm said that sentiment was common among Staten Islanders, who he said identify with underdogs. “They know what it’s like to feel like everyone is against you,” he said.

Mr. Grimm has been helped by Mr. Recchia’s gaffes.

At a meeting with union officials last month, for example, Mr. Recchia appeared to stumble on foreign-policy issues and seemed unable to offer details about the Trans-Pacific Partnership, a proposed trade agreement among the U.S., Canada and some Asian countries. “I’m opposed to the TPP, that’s my position,” he told reporters when asked to describe the agreement.

Mr. Recchia, meanwhile, has a devoted following in his stronghold in southern Brooklyn. Rose Scoppa, 81, of Bay Ridge, said she had known Mr. Recchia since he was a small child and would vote for him, though she acknowledged his opponent’s advantages.

“How handsome is that Grimm?” she said, leaning in with a smile. “He’s beautiful, he is.”

Write to Mara Gay at mara.gay@wsj.com