Christian Ramirez celebrates scoring the winning goal for Minnesota United. (Brett Davis/USA TODAY Sports)

ATLANTA — Minnesota United did New York City FC a big favor Tuesday night, rallying from a late one-goal deficit to upend Atlanta United in a 3-2 victory at Mercedez-Benz Stadium.

Trailing 2-1 in the final minute of regulation, Minnesota equalized behind a Christian Ramirez goal in the 90th minute. Six minutes into stoppage time, Kevin Molino scored the game-winner.

It appeared Atlanta (15-9-8, 53 points) was about to tie NYCFC (16-8-8, 56) for second place in the Eastern Conference prior to Minnesota’s comeback. City still leads Atlanta by three points with two games remaining in the season for each team.

The Loons (35), mired in ninth place in the Western Conference due to a nightmare start this season, improved to 10-16-5.

“We were tired, obviously. It’s been a long few weeks but a successful few weeks,” Atlanta captain Michael Parkhurst said. “We come out of it with just one loss. Obviously, we are disappointed about tonight. We gave it a heck of a fight to come back — down a man, down a goal. We’re disappointed that we couldn’t hold on for the last five or six minutes.”

Minnesota Uopened the scoring in the 48th minute from Abu Danladi. The rookie picked up his eighth goal of the year with a left-footed shot from 18 yards.

In the 58th minute, goalkeeper Kyle Reynish appeared to win a 50-50 ball against Danladi, however he was sent off with a straight red card after video review. Alex Tambakis came on as a substitute, making his Atlanta debut.

Playing with 10 men, Atlanta stormed back scoring twice in the next 15 minutes, starting with Villalba in the 67th minute. Gressel intercepted a pass as Minnesota attempted to dribble out of the back. Gressel dribbled through two defenders and sent in a cross that was deflected toward the top of the box where Villalba was stationed. The Argentine winger then ripped a left-footed shot into the goal.

In the 72nd minute, Gressel gave Atlanta the lead with a blistering shot into the upper left corner. He won a ball in the midfield and sending ahead for Yamil Asad, who maneuvered through a few Minnesota defenders before sending Gressel through on the right wing. Gressel pulled back and fired a left-footed shot into the upper left corner for the lead.

But Atlanta ran out of gas late. Ramirez scored in the 90th minute off of a corner that trickled past Tambakis and an Atlanta defender. In the sixth minute of stoppage time, Molino grabbed the lead by heading in a cross from the left wing.