He dropped his waterlogged loafers off the roof and watched them fall five stories.

Under a leaden sky, raw from a storm the night before, he looked across the cityscape dimpled with apartment lights and inched to the edge.

It would be so easy to lean over and let go, he thought.

G’Mario Charleston had been living on the roof of his former apartment building in Upper Manhattan for two months. He put one foot on the ledge, he said, and envisioned himself falling. Then he heard a baby cry from an open window.

“I broke down to my knees and cried with the baby,” Mr. Charleston, 34, recalled in a recent interview, about a year after that September night.