ATLANTA — Steven Matz’s best road start of the season carried the Mets into the seventh inning Wednesday night and then all hell broke loose.

First, manager Mickey Callaway removed the left-hander at 79 pitches — after allowing him to bat in the previous half inning — and then the usually reliable Seth Lugo produced his first dud of the second half. The Braves singled Lugo into submission, scoring five runs in sending the Mets to a third straight loss, 6-4 at SunTrust Park.

Lugo allowed four straight singles after walking Josh Donaldson leading off the seventh, and the Mets (61-59) never recovered in falling three games behind in the race for the NL’s second wild card.

Callaway defended his decision to remove Matz.

“We had the best reliever in baseball sitting down there in Seth Lugo,” Callaway said. “He’s been doing the job for a month-and-a-half, Matzy is running around the bases and we’ve got Donaldson coming up, [Adam] Duvall coming up and I will make that move 100 times out of 100. That’s the right move in my mind.

“I understand it didn’t work out, but if Lugo comes in there and throws up a zero, two zeroes — which is why we double-switched him in — it gives us more chance to score some runs.”

Callaway said if the Mets got to the ninth with the lead he could have used Justin Wilson if he didn’t want the struggling Edwin Diaz in the game.

The Mets added late drama, scoring twice in the ninth and then loading the bases — after a replay review determined Johan Camargo didn’t have possession of the ball during a transfer as he stepped on second base following Pete Alonso’s grounder — before Mark Melancon struck out Wilson Ramos and Jerry Blevins whiffed Michael Conforto to end it.

Matz retired the final 14 batters he faced on a night he allowed one run on two hits and one walk over six innings. The lefty said he understood the decision to remove him in the seventh.

“I felt pretty good, but Lugo has been really good all year, and a couple of righties who can do some damage coming up, so that was the manager’s call,” Matz said.

Lugo entered to face the middle of the order and couldn’t deliver. Ender Inciarte tied it with an RBI single with the bases loaded before Tyler Flowers hit a grounder under Alonso’s glove that Ruben Tejada fielded with first base uncovered, bringing in the go-ahead run. Three additional runs scored in an inning the Braves collected six singles and a walk. Luis Avilan finally got the last two outs in the seventh.

“I was just unlucky,” Lugo said. “I thought I made a bunch of good pitches. They didn’t really hit anything hard. A little brain fart there not covering first base, I should have known where the defense was, but I thought I made good pitches.”

J.D. Davis’ bloop two-run single in the seventh against Chris Martin gave the Mets their first life after Dallas Keuchel had frustrated them for six innings. Matz’s broken-bat single against Sean Newcomb with two outs started the rally before Amed Rosario singled, taking second on the throw, putting runners on second and third before Davis delivered.

Keuchel threw six shutout innings in which he allowed five hits and two walks with seven strikeouts. The left-hander had been blitzed for eight runs over 3 ²/₃ innings against the Marlins in his previous start.

Matz was shaky in the second, but escaped with only one run scoring in the inning, as Inciarte delivered an RBI double.

Rosario singled leading off the game and advanced as far as third on two wild pitches by Keuchel, but Conforto struck out following a walk to Ramos, ending the threat.

Suddenly, the Mets’ 15 victories in 16 games — a stretch that ended with a loss to the Nationals on Sunday — seems like ancient history.

“We’ve done this before, we have put tough times aside — a tough three games,” Callaway said. “But we have to come out [Thursday] win a game and then go into Kansas City and win some games. We’re still in a good spot. It’s not the end of the world.”