Real Salt Lake stormed back from two goals down to take a lead, but New York made a comeback of its own to take the win.
Tim Cahill opened the scoring and Fabian Espindola netted twice, but a hat trick from Alvaro Saborio looked to have split the spoils until Dax McCarty headed home a winner late in stoppage time.
Cahill opened the scoring with a header from a Thierry Henry free kick, giving the Red Bulls the lead just over 10 minutes into the match.
A penalty call in the 22nd led to the Red Bulls doubling the advantage. Kenny Mansally was called for pulling down Brandon Barklage just inside the box as the two battled for the position as a ball rebounded out from a free kick. Espindola stepped up to clip home the spot kick and give his side a 2-0 lead.
Just before the break Real Salt Lake had a penalty of its own. Markus Holgersson was called for a foul as Olmes García tried to round him in New York's box, and Saborio buried the penalty to pull his side back to within one.
Two quick-fire goals from Saborio late in the second half had Salt Lake eying a win.
In the 80th he netted his second of the night to pull his team level, and the Costa Rican completed his hat trick in the 82nd to put the Utah outfit in front.
But New York would not go quietly.
Espindola won the Red Bulls their second penalty of the night just before the end of normal time and finished off his brace with the ensuing spot kick, pulling the teams back level.
McCarty found a winner in the 95th, heading home a cross to give his team a victory in one of the most thrilling matches of the season so far.