In the 51st minute, Valentine Castellanos fired a shot that was stopped by Toronto goalkeeper Quentin Westberg. The save led to a big rebound opportunity for Medina, who easily converted for his fourth goal of the season and second goal in as many games.
New York City (10-8-3, 33 points) won its second consecutive game. Having already clinched a postseason berth, NYCFC's victory allowed them to keep pace for a top-four finish in the Eastern Conference and at least one postseason home game.
The defeat drops Toronto FC (12-4-5, 41 points) three points behind the Philadelphia Union in the race for first place in the conference standings.
Medina's goal was a deserved breakthrough after NYCFC's attack dominated the first half, controlling over 64 percent of the possession and outshooting Toronto FC by a 7-3 margin. NYCFC hampered themselves with some untimely offside challenges, however, and only one of their shots was on target.
This lack of finishing quality may have saved Toronto FC from another large deficit, four days after Toronto suffered a 5-0 rout to Philadelphia. Toronto didn't generate much attack against New York until the final 10 minutes, and finished the game without a shot on goal.
Nick DeLeon had Toronto's best chance of the match during first-half stoppage time, ringing a shot off the post.
Playing with a roster thinned by injuries, Toronto has lost consecutive games for just the second time all season.
Toronto FC also lost for the first time (3-1-1) in five games at their temporary home on the University of Connecticut campus.
NYCFC goalkeeper Sean Johnson recorded his seventh shutout of the season but didn't record a single save.
Castellanos led New York City FC with six shots, four of which were on goal. His best opportunity was a close-range attempt stopped by Westberg in the 23rd minute.