One of the most-watched — and costly — congressional races in the country is in New York’s Hudson Valley region, where a “carpetbagger’’ lefty activist is going up against an entrenched Republican fixture.

On one side is liberal darling Zephyr Teachout, the Fordham University law professor — and recent transplant from Brooklyn — who gave Gov. Cuomo a surprising run for his money in the 2014 Democratic primary.

On the other is GOPer John Faso of Kinderhook, a state Assembly member for 16 years who had made unsuccessful runs for comptroller and governor. He has resided for decades in the 19th Congressional District, which covers 11 counties in the Hudson Valley, Catskills and Southern Tier.

They are battling over a rare open seat in a crucial swing district, which is being vacated by Rep. Chris Gibson, a moderate Republican who kept his promise about serving no more than four terms.

Gibson, an Iraq War veteran, defeated a Democrat when he was swept into office on the Tea Party wave of 2010, in what was then listed as the 20th District.

The battle for the largely rural district has drawn more than $7 million into the combined war chests, as it could be the seat that shifts control of the House to the Democrats, who need a 30-seat swing in November.

The two candidates are blasting each other across the typical divide of Democrats and Republicans in a district filled with a mix of blue-collar Donald Trump supporters and urban transplants who love Sen. Bernie Sanders.

Faso has been trying to paint Teachout as a tax-and-spend liberal and New York City slicker who does not share the small-town values of the region, since she moved to Dutchess County only in February 2015, not long before announcing her run.

“Do voters want someone who just moved to the district . . . Just parachute in and say, ‘I’m here. I want to represent you?’ ” Faso recently said on WNYC radio.

The “carpetbagger” attack is particularly stinging to Democrats in the area because of the failed 2014 run of party nominee Sean Eldridge, the husband of a Facebook billionaire who bought a $5 million estate in Garrison shortly before he ran there.

And Teachout, who chose to run without being recruited by the party, flatly rejects the “carpetbagger” label.

“It really doesn’t come up much,” Teachout told The Post, adding that Faso has worked as a lobbyist for powerful business interests. “People want someone who is independent.”

Teachout, meanwhile, has been blasting Faso for taking money from a Super PAC run by billionaire hedge-funder Paul Singer as part of her overall call for campaign-finance reform.

She made headlines when she called for a debate with Singer — who she claims wants to “offshore everything” — rather than Faso.

Teachout herself — who has the backing of Sanders — has taken some criticism for having a fund-raiser with liberal billionaire George Soros. She has personally outraised and outspent Faso, with $2.39 million dished out on ads and organizing, with $1.4 million left over, according to OpenSecrets.org. Faso has spent $2.34 million with $297,000 on hand.

Faso, however, has gotten money not only from Singer but $3 million from a GOP Super Pac, the Congressional Leadership Fund, for attack ads on Teachout.

A Sienna College Poll last month found the race was too close to call, with Faso ahead by 1 point, 43 percent to 42 percent, within the survey’s margin of error.

On the issues, the two candidates have a major spilt on free trade, with Teachout’s view looking more like Donald Trump’s, as she opposes NAFTA. Faso, despite his support for Trump, takes a more traditional Republican view, claiming NAFTA has been good for the district through improved trade with Canada.

Teachout, meanwhile, supports taxpayer-financed elections to stop pay-to-play corruption. Faso opposes public financing as restricting free speech.

In the debate over ObamaCare, Teachout supports a public option, as is now in place. while Faso said the law needs an overhaul.

On taxes, Teachout is coming under fire from her Republican opponent for backing a $10 billion increase in the stock-transfer tax and opposing the 2-percent property-tax cap imposed by fellow Democrat Cuomo.