After the debate, his staff produced documentation that Mr. Capuano had voted against both the Stupak Amendment and the Hyde Amendment. At the same time, Ms. Pressley’s staff documented that Mr. Capuano had later supported the landmark health care bill even though it included the Stupak Amendment. In Wednesday’s debate, the issue seemed to be a wash.

Ms. Pressley also said Mr. Capuano had supported immigration legislation that included some funding for President Trump’s proposed border wall. But Mr. Capuano said the measure she referred to was part of a larger bill that provided some protections for undocumented immigrants and that progressives — such as Senators Elizabeth Warren of Massachusetts, a Democrat, and Bernie Sanders of Vermont, an independent — had also supported it.

Ms. Pressley also sought to cast her opponent as weak on gun control, saying that after the massacre at Virginia Tech in 2007, which left 32 dead, Mr. Capuano “said he wouldn’t push for gun control” in the House because “we know we’re going to lose.” After the debate, her staff cited a Boston Globe article from 2007 in which Mr. Capuano was quoted as saying that fighting for gun control is “just not worth it” because some members would lose re-election.

“I don’t remember what I said 10 years ago,” Mr. Capuano replied testily during the debate.

The debate featured several race-related questions, given the district’s diversity.

Asked whether N.F.L. players were right to take a knee during the national anthem in protest of police violence and racial inequality, Mr. Capuano said he approved of their right to protest, but he did not support the tactic because it had been divisive. Ms. Pressley said she approved of both the cause and the tactic.

“It’s important that we are disruptive,” she said.

That led Ms. Pressley into a heated exchange over their differing views of so-called Blue Lives Matter legislation, which extends penalties for crimes against law enforcement officers and was perceived as a countermeasure to the Black Lives Matter movement. House Democrats, including Mr. Capuano, supported the legislation overwhelmingly.

Mr. Capuano said Wednesday he would stand by his vote because it was wrong for people to intentionally target police officers. Ms. Pressley said it was wrong to target black men.