Democratic party leaders insisted the loss wasn’t a harbinger of things to come. “It’s a very difficult district for Democrats,” said Democratic National Committee chairwoman Debbie Wasserman Schultz, noting its Democratic margins there tend to be the second lowest of all the districts in New York City.

House Speaker John Boehner (R., Ohio), dismissed that idea.

“This is a very seriously Democrat district,” Mr. Boehner said. “This is not a district that Republicans have any right to believe we could win.”