That strategy was captured earlier this month at a steakhouse fund-raiser with labor leaders, landlords and lobbyists in Lower Manhattan. Gov. Andrew M. Cuomo was billed as a special guest.

Each side has portrayed the other’s donors as out of touch with average Queens voters in the primary battle, with the winner expected to be a heavy favorite in November’s general election against the Republican candidate, Daniel Kolgan, a lawyer.

“You could make your entire political career out of donors who can’t vote for you, but they’re typically going to be big donors,” said David Fontana, a professor of law at George Washington University, who has written on limitations to out-of-district donations. “Now it’s becoming true for smaller donors.”

Campaign cash flowing in from other states to influence local elections is nothing new: Wealthy donors in big cities have long supported both Republican and Democratic candidates. Activist billionaires like the Koch brothers and George Soros support local campaigns and issues they care about.

But now those with just a few dollars to spare are getting in on the act. Campaigns have taken notice in recent years, soliciting donations using massive email lists and appeals to a common purpose to fuel small-dollar fund-raising efforts on behalf of candidates in far away places — especially Democratic ones.

“It’s like discovering fire,” said Michael Casca, a Democratic strategist and veteran of Senator Bernie Sanders’s 2016 run. “The act of kicking in just a few bucks to candidates up and down the ballot in races across the country is creating an unseen level of solidarity in the movement.”

The approach was seen in Stacey Abrams’s run for governor in Georgia and Beto O’Rourke’s challenge to Senator Ted Cruz in Texas, both of whom received huge numbers of small-dollar contributions from around the country during their failed bids.