The 35-year-old driver, Swinton Acosta, and passenger Elvis Rodriguez, 55, face drug trafficking charges, and Acosta also faces driving violations. The two New York City men were ordered held on $250,000 bail each at their arraignment Tuesday.
Not guilty pleas were entered on their behalf, according to the Daily Item.
The men were pulled over by state police Monday in Lynn for driving 44 mph in a 30-mph zone, Assistant District Attorney Mark Byron said.
Acosta had a suspended license, while Rodriguez acted "inconsistent and evasive" when asked simple questions, the prosecutor said.
During an inventory of the vehicle to prepare it for towing, troopers found a hidden compartment and a state police dog detected the presence of drugs. Police found 18 kidney bean cans containing a combined 7.2 kilograms of what appears to be cocaine, Byron said.
Rodriguez was a passenger in someone else's car and had no idea there were drugs in it, said his attorney, Mark Schmidt.
"There are no facts that tend to substantiate ... that (Rodriguez) knew there were drugs there," he said.
He also questioned the legality of the search of the hidden compartment without a warrant.
Acosta just bought the car and had no idea it had a hidden compartment, said his lawyer, Eric Jarosz. Acosta, who has no criminal record, was driving Rodriguez to a wake, he said.
Both defense attorneys asked for $1,000 bail.
The defendants are due back in court Oct. 22.