Davis, 20 of Dawsonville, Ga., started fourth and won his first race of the season. The victory also broke a nearly 50-race winless streak.
Mayer, of Franklin, Wisc., was second followed by defending race chanmpion Derek Kraus, David Gilliland and Parker Retzlaff. Pole sitter Chase Cabre ended in 13th.
“We were the best car in the end,” Davis said. “We’ve been working hard. Working long hours. These last three laps were the best three laps of my life.”
Davis had been trailing for the first 94 of 97 laps. But on a restart after a caution flag when Hailie Deegan had a flat tire, Davis used his driving experience to get past Mayer in turns 1 and 2.
On the restart, Mayer went to the bottom and Davis headed for the top and got around Mayer. Then on the penultimate lap, Davis thought he was going to get moved out of the way by Mayer, which happened last week when the series raced at Bristol (Tenn.) Motor Speedway.
But Mayer slid up the track and Davis started celebrating.
“We stole it from the 21,” said Davis, who ended in fourth at Bristol. “It feels good to say that because he’s been the dominant car all year and he’s probably going to win the championship. We just did what we could do to exceed what we’ve got.
“I needed a mistake, he gave it to me and I took it. You can’t crack under pressure. I finally broke his armor a little bit.”