On the campaign trail, Mazi Pilip wears a Star of David around her neck. She speaks with a thick Ethiopian-Israeli accent. And when it comes to the Israel-Hamas war, Ms. Pilip, the Republican nominee in a special House election in New York, adds no political polish.

“Oct. 7 changed me forever,” she said the other day, her voice cracking, at a vigil for a local man who was taken hostage by Hamas. Ms. Pilip, an Israeli military veteran, called him “my brother.”

“The vicious attack of Hamas on my people, on my brothers and sisters, and our Jewish land — a vicious attack — we are never going to forget,” she said, as the packed gymnasium of the suburban Jewish community center nodded along.

Many politicians have rushed to stand by American Jews since the war began. But few have made the conflict so viscerally central to their political identity as Ms. Pilip, 44, a little-known county legislator whose remarkable personal story and unusual overtures to Jews across the political spectrum have propelled her into a dead heat with Tom Suozzi, a former Democratic congressman.

Their Feb. 13 contest will turn on myriad national issues, particularly the crisis at the border. But Ms. Pilip’s approach has also transformed the race into a test of just how thoroughly the conflict and fears over rising anti-Israel sentiment have shaken political alliances for suburban American Jews, long a bedrock of the Democratic coalition.

“Oct. 7 was a seismic event in more than just Israel,” said Lawrence Levy, dean of the Center for Suburban Studies at Long Island’s Hofstra University. “Fairly or not, there’s a perception I hear from Jews, who I know have been loyal Democrats with their time and money, and now wonder if the party is safe for them.”