Minas Gatas was arrested after a sting operation on Monday evening. He was arraigned Tuesday.
Prosecutors say undercover officers made two drug buys, including an $830 cocaine purchase.
At the time, the truck was parked at Owls Head Pier on the waterfront north of the Verrazano-Narrows Bridge.
The undercover asked for a vanilla ice cream cone.
Gatas was arraigned Tuesday. A message left for his lawyer was not immediately returned.
Prosecutors say during the two-month sting operation, detectives also bought drugs from a deli where Gatas worked.
The ice cream truck was an independent operation, not affiliated with any well-known company.