New York City FC (15-11-7, 52 points), who won their first MLS Cup title last season, secured a top-four finish in the Eastern Conference standings.
Orlando City (13-13-6, 45 points) remained in sixth place with two games remaining.
Orlando City controlled the ball early on and had chances with three corners in a span of two minutes. In the seventh minute, Ruan volleyed a long throw-in that went wide and on the ensuing corner, defender Rodrigo Schlegel sent a header wide of the net.
Magno had a chance to get New York on the board in the 11th minute but his header from the top of the box went wide.
A minute later, NYCFC thought they had a 1-0 lead when Tavon Gray headed one in from the right side but an offside call was confirmed after video review, denying the homegrown defender of his first career MLS goal.
Magno again tried to break the ice for New York in the 24th minute with a header inside the 6-yard box but the attempt went over the crossbar. The Lions had six shot attempts in a scoreless first half to New York City's two.
Alexander Callens capitalized on Orlando's inability to clear the ball while bringing NYCFC even in the 66th minute. Amid a scramble inside the box, Magno fed Callens for the goal and a 1-1 tie.
Magno put New York ahead 2-1 in the 81st minute, taking a short feed from Gabriel Pereira along the right side and directing it into the far side of the net.