Moralez scored an 85th-minute winner at Yankee Stadium to lift City above their rivals and into second in the Eastern Conference.
The result also ended the Red Bulls' four-match unbeaten run in MLS.
Both teams had their chances in the first half, before Kaku put a great chance just wide for the visitors in the 74th minute.
City punished their rivals with five minutes remaining. After a Red Bulls giveaway, Moralez finished a Jonathan Lewis pass to give Domenec Torrent's men the win.
The win continued NYCFC's stellar home record in 2018, with the team winning eight and drawing one of their nine matches at Yankee Stadium.