The pattern has also been fairly common beyond Virginia this year. In special congressional elections, Republicans have fallen far short of Mr. Trump’s strong showing in white working-class areas, while Democrats have struggled to exceed Mrs. Clinton’s showing in the areas where she excelled, like Georgia’s Sixth Congressional District.

But the Virginia contest seems to have a distinct dynamic. Mr. Gillespie, with establishment roots as a former chairman of the Republican National Committee, has run a campaign plainly intended to rally Mr. Trump’s supporters, making the question of whether he can approach Mr. Trump’s strong tallies somewhat more interesting.

If Mr. Gillespie prevails or runs well ahead of Mr. Trump, it might be interpreted as a sign that establishment Republicans can excel by embracing Mr. Trump’s message. According to this view, they could lure white working-class Trump supporters with his message on race and immigration, while maintaining greater support among well-educated voters with their establishment-friendly credentials and tone.

Even if Mr. Gillespie loses by a small margin, his campaign could be judged a success, given national political conditions and Virginia’s Democratic lean.

Mr. Northam entered the race as a clear if modest favorite. Virginia, with a high percentage of college-educated voters, backed Mrs. Clinton by a five-point margin in November, and the national political environment would seem to be very favorable to a Democrat.

The party out of power has generally won the Virginia governor’s race, and Republicans have underperformed in this year’s special elections. Mr. Trump’s approval rating has consistently been in the 30s, and Democrats have a considerable lead on the generic congressional ballot. These conditions are consistent with a so-called wave election, like the ones that swept Democrats into power in the House in 2006 and back out in 2010.

But Mr. Trump’s approval rating was at 39 percent in the Upshot/Siena survey, with his disapproval at 51 percent. These figures are somewhat better for Mr. Trump than those of most other surveys — perhaps in part because this poll tries to capture likely voters in an off-year election, and those voters are considerably older and whiter than the overall adult population.