"An angel caught him with the tree," neighbor Anne Varela told CBS Boston station WBZ.
The boy was leaning on a screen at the Captain's Cove condos, in Quincy, Massachusetts, when he fell, according to police.
His fall was broken by a tall tree before he hit the ground.
Muhammad Khan was in his room when the boy fell and said he heard him tumbling by his window.
"I heard something by my window and it fell down really fast, so I thought it was something random so I just ignored it, and then a few seconds later I heard a lady screaming at the top of her lungs and I saw a kid on the ground and I was like, oh my God, a kid fell."
Khan added, "Then I went back to the balcony and then I actually saw the kid get up, and he started walking."
The child, who never lost consciousness, was taken to Boston Children's Hospital.
"It is really like a miracle, I think his guardian angel was definitely there," said Kathy Hogan, a neighbor.
"They neck-braced him up. He was screaming so that was a good sign," recalled Ed O'Connor, another neighbor who saw the fall. "Lungs were good — that's all we knew at the time."
According to Khan, the boy appeared "perfectly fine."
Falls are the leading cause of non-fatal injuries for children and teens, according to the U.S. Centers for Disease Control and Prevention. Every day, about 8,000 kids are treated in emergency rooms for fall-related injuries — almost 2.8 million kids a year. Putting up window guards and making sure young children are supervised can help prevent life-threatening falls.
Last month, another Massachusetts boy survived tumbling from a second-story window when a stuffed animal broke his fall.
Doctors say the 5-year-old in the latest incident is expected to be fine.
"It's like a miracle," said O'Connor. "I mean, I wish the kid was yelling out numbers because I would have grabbed a couple."
© 2017 CBS Interactive Inc. All Rights Reserved.