Authorities were called to the neighborhood of million-dollar homes on Long Island's so-called "Gold Coast" shortly after 11 a.m.
The man in his thirties had been working with a crew digging a new cesspool outside an East Hills home. Firefighters said he was more than 30 feet down when the dirt walls surrounding him began to collapse. Another worker made out safely.
The man, who was not immediately identified, was taken in stable condition after being taken to Nassau County Hospital.
Rescue personnel monitored the victim's vital signs throughout the rescue operation and he was always in stable condition, Assistant Roslyn Fire Chief Adam Boll said.
In addition to rescue workers from various local volunteer fire departments, the Fire Department of New York sent its excavation team to the site on Long Island, and Consolidated Edison and the Long Island Power Authority also sent equipment.
"He seemed pretty calm," Con Ed mechanic Vinny Bourne said of the victim. Con Edison dispatched a large vacuum truck to the scene to help clear dirt from the hole.
"They had a splint on his arm and he had an IV, but he seemed to be OK," Bourne said.
Students at a nearby elementary school were evacuated when a helicopter landed on school grounds.