Gibbs, a Cup Series regular and a rising star at Joe Gibbs Racing, dominated the road-course race in upstate New York. He led 70 of 86 laps, but a late caution bunched up the field and gave Mayer a shot.
Mayer took advantage by nudging Gibbs out of the way as they entered the first turn. Mayer said the contact was accidental.
"I wheel-hopped it," said Mayer, whose first Xfinity victory came last month at Road America. "I feel bad for doing that, obviously. You don't want to take out a Gibbs car like that or any car like that. But just trying to get another win in the Xfinity Series. I got a lot of catching up to do.
"I was in there. I put my nose in there. That's part of it. Fenders are fenders. It's an accident, but I think everyone can agree that it's OK for a Xfinity Series regular to win this race."
Gibbs collected his car after the spin and came home a disappointing 17th.
"When you have to race out of desperation like that and wheel-hop and clean the leader out, I guess you can call it a racing deal. It just really [stinks]. ... Definitely [stinks] to get cleaned out there."
Gibbs brushed off any notion of chatting with Mayer about the ending and then took a clear shot at his rival. The two have had altercations before, and Gibbs even threw punches at Mayer last year at Martinsville.
"I don't really know how much of a conversation you can have with him in that situation," Gibbs said. "We grew up racing each other. I think he has more starts than I do, and this is his second win. Congratulations to him on his second win. Definitely wish I could have gotten my 13th there."
Gibbs had the field covered all afternoon on the 2.45-mile, multi-elevational track. He blew past Hill on one restart and then skated by Mayer and Justin Allgaier on another with four laps to go.
Riley Herbst lost ground in the race for the final playoff spot.
Herbst entered Saturday with a 34-point lead over Parker Kligerman, but Herbst broke a track bar mount late in the second stage and ended the race earlier than expected. Herbst finished 35th, allowing Kligerman to close the gap to three points with three regular-season events remaining.
"As far as the points situation, it's just frustrating," Herbst said. "I don't think we should be in this position. Luckily, next week isn't the cutoff line for the Xfinity Series and we still have some track for us, for Stewart-Haas Racing. It's just frustrating that things like this, out of our control, keep happening. It'll turn around one day, and when it does, we'll be happy."
Herbst spent much of his day dealing with transmission issues; he had to hold the shifter in fourth gear throughout practice and the race.
The Xfinity Series goes to Daytona International Speedway on Friday, with three races remaining before the playoffs.