PORTLAND, Ore.—To find enough votes to win the governorship in a state that last elected a Republican leader in 1982, Knute Buehler has focused on voters like Danielle Miller.

A 47-year-old mortgage-loan officer, Ms. Miller voted in 2016 for Kate Brown, Oregon’s incumbent Democratic governor, but has since grown disenchanted with her on issues including education funding and homelessness.

This year, Ms. Miller isn’t planning just to vote for Mr. Buehler, a two-term Republican state representative. She is campaigning for him and even appeared in one of his commercials.

“This is the first candidate I’m crossing party lines for in 20 years,” she said on a sunny Sunday morning in east Portland, before knocking on doors to solicit votes for the Republican. “Oregon is so behind in so many ways...under our current leadership.”

Mr. Buehler, 54, is aggressively courting moderate Democrats unhappy enough with Ms. Brown that they will defy their party despite the highly partisan national atmosphere. His strategy has turned the campaign for the governor’s office in Oregon into a race that is tighter—and tenser—than expected in this solidly blue state.