The man - whose name was not disclosed - was digging the hole to install a water line at the Westfield site when he became trapped around 1 p.m.
He then remained stuck from the waist down for more than two hours as rescue crews worked to free him.
The worker was conscious and alert when he was removed from the trench and taken to a University Hospital in Newark. But further details on his injuries were not immediately available.
The cause of the trench collapse remained under investigation late Saturday afternoon.