New York City served as the temporary national capital when the United States government began under the Constitution in 1789.
Congress met in New York City at Federal Hall, where George Washington was inaugurated on April 30, 1789. The city remained the seat of the federal government until 1790, when Congress passed the Residence Act selecting a site on the Potomac River for a permanent capital.
Philadelphia then served as the temporary capital for ten years, from 1790 until 1800. The federal government moved to Washington, D.C., in 1800 after construction and administrative preparations made the new capital usable.
New York City was not the only place where the Continental Congress or Congress under the Articles of Confederation had met. Earlier sessions took place in cities including Philadelphia, Baltimore, Annapolis, and Princeton. The 1789 answer refers specifically to the first capital of the constitutional federal government, not every wartime or Confederation-era meeting place.