Alexander Callens fired in the winning spot-kick at Portland’s Providence Park as New York City’s first final in their seven-year history ended in victory.
Valentin Castellanos’ 41st-minute header had put New York City ahead.
However, Felipe Mora struck in the fifth minute of stoppage-time as 2015 winners Portland forced extra time.
With neither side able to find a winner, Sean Johnson made two superb saves to deny Mora and Diego Valeri before Callens held his nerve to seal an historic first title.
New York City FC became the 20th Major League Soccer franchise in 2013, after English club Manchester City agreed a partnership with baseball giants the New York Yankees.
Since playing their first MLS season in 2015, the club have had well-known European players including former Spain striker David Villa, Italy legend Andrea Pirlo and ex-England midfielder Frank Lampard among its squad.
Both finalists had come through a 34-game regular season and three play-off rounds to reach Saturday’s showpiece, with New York City beating Philadelphia Union 2-1 in the Eastern Conference final while Portland overcome Real Salt Lake 2-0 in the West final last weekend.
Attacking midfielder Maxi Moralez was denied by Portland goalkeeper Steve Clark inside the opening minute as the visitors made a positive start on the artificial turf.
The Argentine’s free-kick late in the first half was met by MLS Golden Boot winner Castellanos, whose header rolled into the bottom corner to give Ronny Deila’s side the lead.
New York City’s celebrations were cut short, however, as team-mate Jesus Medina was struck by a missile from the crowd.
Medina was cleared to continue and Portland announced shortly after that the fan responsible had been ejected from the game and banned from the stadium.
Portland’s Argentine playmaker Sebastian Blanco, playing in his third major final for the club, caused New York City problems but he shot narrowly wide with a long-range attempt in first-half stoppage time as the home side failed to land a shot on target before the interval.
Hosting the final for the first time, three-time finalists Portland struggled to create opportunities until Mora followed up Jaroslaw Niezgoda’s initial blocked shot to send Providence Park into raptures.
The latest goal to be scored in normal time in MLS Cup history was celebrated in signature style by the team’s chainsaw-wielding mascot Timber Joey.
Cristhian Paredes drew a save from New York City goalkeeper Johnson with the best chance of extra time, and some spot-kick heroics from the American stopper proved crucial before Callens blasted the decisive penalty past Steve Clark.