NEW ALBANY, Ohio — There was a pitiable chance of success when Danny O’Connor knocked on Tami Halliday’s door Thursday morning to ask for her vote. All the data showed that Mr. O’Connor, a Democrat running in an August special election for a House seat here, was all but wasting his time.

But when Ms. Halliday asked him his stance on gun control, things got brighter fast. Mr. O’Connor said he favored an assault weapons ban, along with preventing people with domestic violence records and mental illness issues from having guns. “Do you take money from the N.R.A.?” she asked. “No,” Mr. O’Connor replied. “I have an ‘F’ rating from the N.R.A.”

With that, Ms. Halliday, who voted for President Trump in 2016, said she would vote for Mr. O’Connor.

The special election in a region that stretches from the affluent suburbs of Columbus to the Appalachian foothills east of Zanesville could be the next big test of the vaunted “blue wave” brewing for November. The nonpartisan Cook Political Report rates the race a tossup.