JACKSONVILLE, Fla.—For months after Republican Adam Putnam entered the Florida gubernatorial race, he seemed almost unbeatable. He had a record of government experience and political success, a trove of endorsements, robust fundraising and a solid lead in most polls over his principal rival, GOP Rep. Ron DeSantis.

Then Mr. DeSantis, a vocal defender of President Trump, picked up the president’s endorsement in June, touted it in a new ad, and appeared with Mr. Trump at a campaign rally in Tampa. Mr. DeSantis shot to the lead...