ATLANTA — There was no way the Mets were losing on Thursday, not after Pete Alonso dunked a fastball into a water display high above center field for a three-run homer in the first inning. It was the first of five hits for Alonso, whose teammates added 18 more.

As the Mets left for Kansas City — and more outfield fountains at Kauffman Stadium — some of their swagger had returned. They had outlasted the Atlanta Braves, 10-8, for their first victory after three losses in a row and a hamstring injury to Jeff McNeil, their All-Star leadoff man. A sweep here would have stifled the momentum of the 15-1 stretch that vaulted them into the pennant race.

“We needed a win today, for sure,” Alonso said, adding later, “Every game matters at this point in the year. We’re right there, we’re right there in the hunt.”

It is hard to draw conclusions from any set of three games, but the Braves showed just how hard it will be for the Mets to climb into the playoffs. The games just feel different against dangerous, highly motivated teams. Marcus Stroman, the Mets’ starter, knew he could not cruise with that early 3-0 lead.