RTaty Castellanos entered the match with two goals and left it with five. (Vincent Carchietta-USA TODAY Sports)

BRONX – If there was a crowd at Yankee Stadium, the fans certainly would have gotten their money’s worth in the 18th edition of the Hudson Red Derby Sunday night.

There were goals galore, leading changes and even some goalkeeping heroics.

New York City had plenty of heroes in its 5-2 emphatic victory over the Red Bulls in the closed-door match.

Quite appropriately, Taty Castellanos has the first and last words, scoring the opening and final goals while accruing a hat-trick while adding an assist. Castellanos entered the MLS contest with only two goals this season. Team captain Alex Ring fired home a spectacular, game-winning goal to snap a 2-2 tie in the closed-door match.

“Coming into the game I know I was playing well and I was helping the team, but the goals weren’t coming for me,” Castellanos said. “They finally did today. This was my first hat trick and to be able to help the team was the most important thing. With this being a rivalry game we had to step it up and play well and I’m just really happy.”

With both teams already having securing playoff berths in the postseason heavy Eastern Conference (10 of the 14 teams will qualify), the encounter was more of trying to earn a higher seed and home-field advantage, especially to avoid a play-in match.

The less games the better in the playoffs.

The victory lifted NYCFC (11-8-3, 36 points) into fourth place in the conference beyond the eighth-place Red Bulls (8-9-5, 29), who had their five-game unbeaten streak and three-game road undefeated streak snapped.

“On some of those plays we were too lax when we needed to be firmer, stronger, get tighter on the guys, tackle harder,” said Brian White, who has scored three goals in his last tfour matches. “When it comes down to a team like us where we want to bring energy, we want to get tight on guys, not give them any space, press hard, attack fast, didn’t feel like we were up to that challenge today. We need to bring that every game, because that’s what has made us successful, and will make us successful, so it’s disappointing. ”

Not so for NYCFC head coach Ronny Deila.

“We played two good halves today, we didn’t start slow, but they are aggressive and hard to play against, especially in the beginning of games,” he said. “We get 1-0, they come back in 2-1, they had very strange goals. We just kept doing the same good things and we deserved to get the equalizer before the break. Then we just needed to do the same things we did in the first half, because we were a better team.”

In a game kicked off on a wet, slick field, the opening 45 minutes turned into a wild 2-2 encounter.

NYCFC struck first in the 12th minute when Castellanos, left alone by defender Jason Pendant, headed home a perfect Maxi Moralez feed past goalkeeper Ryan Meara.

Six minutes later, however, the Red Bulls equalized. Cristian Casseres, Jr. fell to the ground but not before sending a short pass to Brian White, who fired a low 24-yard shot into the lower left corner past goalkeeper Sean Johnson for a 1-1 deadlock. It was White’s first MLS goal scored from outside the penalty area.

On a rather non-textbook play, the visitors managed to grab the lead in the 38th minute. This time White, with his back to the goal, sent the ball out to Casseres and the Venezuelan midfielder drilled a shot that deflected off NYCFC defender Maxime Chanot and into the goal for a 2-1 advantage.

Then it was the hosts’ turn to knot things up as Gary Mackay-Steven did just that, converting a Castellanos pass into the RBNY goal for a 2-2 tie in the 42nd minute.

“We had a game plan,” Mackay-Steven said. “We stuck to it. We knew it was going to be fast paced from the start. There were goals. We went ahead then they got straight back into it and they went ahead. We just need to focus on our game plan, our strengths, and what we would like to do. It was a good performance in the end and we took a lot of our chances.”

NYCFC picked up where it left off six minutes into the second half behind captain Ring’s fourth goal of the season. Jesus Medina started the scoring sequence with a simple throw-in to Ring, who found some space and drove a shot from just outside the right side of the box into the far left corner and a 3-2 City edge in the 51st minute.

“We scored some beautiful goals,” Deila said. “This gives us more confidence, gives us belief that when we do the job and follow up the plan, then we have some really good football players out there. We showed that today. We are hard to beat and we got three points.”

City was not content with a one-goal as it kept plugging away. The host side had a pair of opportunities to add to its advantage in the 61st minute, Meara thwarted Mackay-Steven from point-blank range and then Moralez from further out to keep the score at 3-2.

Castellanos found his second goal in the 76th minute to spot his side a two-goal lead.

Eight minutes later, Castellanos made it a hat-trick after Red Bulls center back Tim Parker was called for taking down Moralez in the box. Castellanos powered a shot into the lower left corner as Meara dove the other way to make it 5-2. Castellanos also grabbed the team scoring lead with five goals.

Red Bulls interim head coach Bradley Carnell took the blame for the loss.

“If you allow a team like New York City to pass the ball around at ease and at will, it’s going to be tough for anybody, and we pride ourselves on our proactive defending.” he said. “I felt that slipped away from us today. Again, can’t blame the players, this is something that has to go on my cap and I take full responsibility for it. ”