At first I wondered if it was some kind of subway accident. But then I realized I didn't live close enough to a subway for that to be the case... everyone in our multistory apartment went outside and we decided we would spend the rest of the day in the park across the street, far from any buildings, to be safe. I had just gone back inside when the aftershock hit.
I did a little more research into where one should be during an earthquake. The consensus seems to be that building collapse is not likely in the U.S. When an earthquake starts, find the nearest load-bearing wall and/or a sturdy table to hide under. Walls around staircases tend to be stronger. But don't go down any stairs because the earthquake shaking will likely make you fall.
I was afraid of a stronger earthquake the second time around - in 2011, Japan had a magnitude 9.0 earthquake 2 days after a magnitude 7.3 earthquake. Strong earthquakes in the Himalayas are preceded by a weaker earthquake 10% of the time. But the behavior is different in different parts of the world, and in the NYC metro area, this doesn't really happen. The strongest earthquake in the NYC metro area was a 5.2 in 1884, apparently.