"He's lucky because he got in the track underneath the train," friend Pedro Cruz, 60, told the New York Post.
The incident followed Cruz's attempt to lob a bag of food - containing rice, beans and catfish - to the unidentified man across from the opposite platform.
"He tried to jump down [on the tracks] and get the food. But then boom, he fell," said Cruz. "He fell right behind the food."
"I jumped down after him. I couldn't get him," Cruz added. "I said, 'Yo! Yo! Yo! Lay down under the train!"
Several bystanders tried to alert the train-driver but he was too close to stop.
One witness, Roy Gomez, 27, said: "I saw the conductor's face and it was all red. He looked shocked. This s**t is crazy."
Police and firefighters arrived to find the homeless man still wedged under the train.
They managed to free him unharmed, and he walked out of the station in the company of police officers, wheeling the shopping-basket he had left on the platform.
Authorities took him to Harlem Hospital, solely as a precaution.