CHICAGO (CBSNewYork/AP) — Valentín Castellanos had a goal and an assist, Maximiliano Moralez had two assists, and New York City FC beat the Chicago Fire 4-3 on the final day of the regular season Sunday.

NYCFC will play Orlando City in the Eastern Conference semifinals and Chicago (5-10-8), which is winless in its last six games, was eliminated from MLS playoff contention.

READ MORE: Fruit Stand Worker Injured In East Side Crash Still In Pain, But Grateful To Be Alive: 'I Thank God Morning And Night'

Castellanos, who recorded his first career hat trick and had an assist in the last game against the New York Red Bulls on Nov. 1, ran onto a misplayed ball by Chicago’s Miguel Ángel Navarro and tapped in a roller from near the spot for the tiebreaking goal in the 77th minute.

READ MORE: Queens Neighbor Holds Rally In Solidarity With Asian-American Community

Alexander Callens headed home a corner kick by Moralez to open the scoring in the 15th minute and Gary Mackay-Steven scored in the 32nd to put New York ahead 2-0. Mackay-Steven has two goals this season, both in the last two games.

Chicago’s Robert Beric answered with a goal about a minute later but Jesús Medina blasted a rising first-timer off a pass from Moralez to give New York City a 3-1 lead in the 37th minute.

Przemyslaw Frankowski scored in the 42nd and then again in the 43rd to tie it at 3.

New York City (12-8-3) has won four consecutive games for the first time since a five-game win streak from Aug. 17-Sept. 7 of last season.

MORE NEWS: Child Hit By Fire Truck, Seriously Injured On Staten Island

(© Copyright 2020 CBS Broadcasting Inc. All Rights Reserved. The Associated Press contributed to this report.)