What happened first election or New York becoming the capital?

Neither event occurred. New York City was the temporary capital of the United States from 1785 to 1790, but Washington D.C. became the permanent capital in 1800. The first presidential election was held in 1789.
Copyright Wanderlust World © https://www.ynyoo.com