NYCFC’s Maxi Moralez (right) celebrates his penalty kick conversion. (Dennis Schneidler-USA TODAY Sports)

BRONX — A slow start and a better finish turned out to be the recipe for New York City FC Saturday night as it recorded a 2-1 victory over the Red Bulls in the Hudson River Derby at Yankee Stadium.

After spotting the Red Bulls an early 1-0 lead, City came back behind goals by Maxi Moralez and Heber scored before a crowd of 28,895. Only a stellar performance by Red Bulls goalkeeper Luis Robles stopped NYCFC from turning the game into a rout.

“Of course, anytime you play the derby and you win you get more confidence,” Heber said.

NYCFC finished the final six minutes of injury time with 10 men as defender Ronald Matarrita was red carded for head butting Red Bulls defender Michael Amir Murillo three minutes into stoppage time. Six yellow cards were handed out, six to each team.

The win kept City (13-5-8, 47 points) in third place in the MLS Eastern Conference a point behind leaders Atlanta United and the Philadelphia Union as the inconsistent Red Bulls (41) dropped to 12-11-5.

The result split the season series at one game apiece, although the Red Bulls still lead the all-time series, 7-5-2. The only other time they can meet this year would be in the MLS Cup playoffs.

“I thought we deserved to win the game and I’m very happy for everybody because their effort was fantastic,” City head coach Dome Torrent said. “That’s what I mean when I say play with personality… I doesn’t matter if you play against Atlanta, Toronto, or LA, you can play in this style.

“We practiced a different system, we played a 4-4-2, with Mitriță and Moralez between the lines. We won the second balls which is very important against Red Bulls. I’m especially happy because we were able to show good build up in our stadium against these kind of teams. When I talk about the personality, it’s about that. Sometimes we can play long ball, we have signals for that, but we play much better when we play short.”

Added Moralez: “We’re doing well. We know what we want and what we’re looking for. We have a couple games in hand and obviously winning the games we have left we can go to the top. We’ll enjoy this moment, but we’ll get some rest to be ready when we come back against Vancouver.”

NYCFC dominated play and opportunities in the opening 45 minutes, but it was the Red Bulls who put one on the scoreboard first.

That occurred in the 10th minute off a City turnover. Kaku got the ball and fed New York City native Alex Muyl, who fired a 12-yard shot past goalkeeper Sean Johnson for his third goal of the season and first since March 16.

The hosts pushed forward and created chaos in front of the Red Bulls’ goals. Had it not been for the woodwork and Robles they would have walked into the locker room with a 4-1 halftime lead.

A powerful Castellanos header bounded off the crossbar in the 20th minute and Heber drilled a shot off the right post off a long drive in the 36th minute before Robles knocked away a shot by the Brazilian striker seconds later.

Robles also sprawled to save a Keaton Parks header in the 32nd minute and parried away an attempt by Alexandru Mitrita just before the halftime while.

While the Red Bulls captain was brilliant, he certainly was not perfect as he could not stop Moralez’s penalty kick in the 43rd minute. That was set up by Panama international defender Murillo, who pulled down Moralez in the box.

Moralez sent his ensuing spot kick down the middle of the goal while Robles dove to his left in vain as the teams walked off the field in a 1-1 halftime deadlock.

“We knew we needed to come out with the same or even more intensity and aggressiveness in the second half,” Moralez said.

NYCFC and Robles picked up from where they left off in the second half, with the veteran goalkeeper managing to make outstanding saves to keep the match from becoming a rout and City connecting for the go-ahead score.

After Castellanos sent a drive off the left post in the 49th minute, NYCFC grabbed the lead four minutes later on a pretty play. An overlapping right back Anton Tinnerholm fed Heber with his back to the goal at the near post. Still, the striker managed to sent a back-heel attempt through Robles’ legs into the net for a 2-1 City advantage and his 13th goal of the season.

“I’m very happy to be able to score,” Heber said. “For us forwards, we always have a better night when we score.”

Robles came up big again in the 56th minute, denying Tinnerholm with yet another spectacular save as Parks headed the rebound wide left.

Johnson was called into action as he parried a Daniel Royer shot out of bounds, but nothing came of the ensuing corner kick.

Red Bulls striker Bradley Wright-Phillips, making his first start in almost four months after suffering a groin injury and the series all-time goal-scoring leader (12), was relatively silent. He sent a close-range shot wide left in the 26th minute and was replaced by Tom Barlow in the 77th minute.