Thiago Andrade opened the scoring for the Boys In Blue and Heber doubled the advantage eight minutes later.
Jesus Batiz made it 2-1 in first-half stoppage time, but Maxime Chanot ensured NYCFC progressed to the Round of 16, restoring the two-goal lead with just under quarter of an hour to play.
Story of the match
The Boys In Blue had to withstand some sharp play from the MLS Next Pro side early in the game as Rochester threatened with runs down the flanks and quick counters.
Just 38 seconds into the match, Raymond Drai found space on the right side inside the box, but his shot was just wide. Gibran Rayo barely missed an open net on a feed from Christian Wood on 17 minutes.
In the 23rd minute, the MLS champions went in front. Gabriel Pereira cut onto his left foot and floated a cross onto the top of the penalty area for Andrade, who beat Phillip Ejimadu with a first-time lob.
Eight minutes later, Ejimadu gifted NYCFC their second, botching a back pass and why he tried to play it, it bounced off of Heber's thigh and bounced into the net.
Jesus Batiz cut the deficit in half in the third minute of first-half stoppage time, poking a loose ball past Luis Barrazza.
Rochester was unable to create the same good opportunities in the second half as they did in the first and in the 76th minute, Chanot headed home from a Santiago Rodriguez corner.
Ejimadu partially redeemed himself for his error on NYCFC’s second goal by saving Gedion Zelalem's penalty after Andres Jasson was fouled late.
Both teams had players sent off late on. Pereira received his second yellow in a fracas inside the penalty area following the penalty save and Rochester’s Preston Popp in added time for kicking a player.
Man of the match: Maxime Chanot
Returning from injury, he picked up a goal and brought stability to the back line.