Piquet, the Brazilian whose father won three Formula One titles, also won at Road America in Wisconsin in June.
Crafton took the lead on a restart after the final caution, with Piquet close behind. Piquet went to the bottom of the track on the final lap, and passed Crafton in the second turn.
"He (Crafton) was running high all the time," Piquet said. "When I saw him running up, I started attacking the bottom for a few laps. And it worked in the end.
"I was trying (to pass Crafton) every lap. It wasn't because that was the last lap."
The final pass was the 17th lead change, two more than the previous Las Vegas record set in 2009.
"That is just the hardest way to lose a race," Crafton said. "I will not sleep for a week. I'll be thinking what I could have done different."
Ty Dillon was 10th and held on to the series lead, ahead of Buescher by one point with five races remaining. Peters is third in the standings, 24 points behind leader Dillon.
During a caution period that ended on lap 106, Dillon collided on pit road with Mayhew and dropped out of the top 10 until the final few laps.
"We had an awesome truck tonight," Dillon said. "Coming off pit road, I really don't know what happened. I'm proud of my team because we battled back. It hurts a little bit, but we still have the points lead."