The goals were the first four of the season for Castellanos.
Castellanos' second and third goals came from the penalty spot for defending MLS Cup champions NYCFC (2-3-1, 7 points), who snapped a two-match MLS losing streak.
Thiago Andrade added his second and third goals of the season for City in their first match since losing their two-game CONCACAF Champions League semifinal series to the Seattle Sounders 4-2 on total goals. New York drew the second game 1-1 at home on Wednesday night following a 3-1 loss in Seattle.
Santiago Rodriguez added two assists in NYCFC's second 6-0 win in club history, one that also marked RSL's worst-ever margin of defeat.
Salt Lake (3-2-3, 9 points) is now winless in its last four matches (0-2-2) after being outshot 22-12 overall and 12-5 in terms of efforts on target.
The 23-year-old Castellanos scored 19 goals and contributed eight assists to win the MLS Golden Boot during the 2021 regular season, then added three more goals in a postseason that culminated in NYCFC's first MLS Cup triumph.
But after a widely expected offseason move abroad did not materialize, the Argentine had been frustrated so far in league play despite three goals in New York's now-concluded CCL campaign.
That frustration came to an end only nine minutes into Sunday's contest. He escaped the defending Tate Schmidt to pound a firm header of Rodriguez's corner kick past goalkeeper Zac MacMath to open the scoring.
After Andrade's first made it 2-0 in the 15th minute, Castellanos converted his first penalty in the 40th minute. Schmidt caught Keaton Parks in the face with a high boot inside the penalty area to set up the opportunity.
Andrade scored his second 10 minutes after halftime, and Castellanos had his third in the 57th minute after he drew a second penalty himself.
He completed his career day -- and the 14th four-goal game in MLS history -- when he latched onto an errant pass from MacMath in the 80th minute and sent a deflected strike past the goalkeeper.
The MLS record of five goals was set by Clint Mathis of the Dallas Burn in 2000.