NYCFC celebrates Jesus Medina’s goal. (David Butler II-USA TODAY Sports)

EAST HARTFORD, Conn. – For the first time in five games, New York City FC defeated Toronto FC Wednesday.

NYCFC can thank Jesus Medina for that.

Medina slotted home a rebound of a Valentin Castellanos shot in the 51st minute to lift City to a 1-0 win over Toronto FC at Rentschler Field.

Toronto has been NYCFC”s thorn in its side over the past several seasons, showing City the door in last year’s MLS Cup playoffs.

It was NYCFC’s second victory in a row over a Canadian team, having dispatched the Montreal Impact, 3-1, on Saturday night.

NYCFC is 9-3-3 in its last 15 games.

Goalkeeper Sean Johnson, who wasn’t severely tested, registered the clean sheet.

Next up for NYCFC: the Hudson River Derby vs. the Red Bulls at Yankee Stadium Sunday at 7 p.m.