The boat, carrying more than 50 passengers of various nationalities, had "sustained damage caused by water getting in", the National Guard said in a statement.
Tunisian media said the boat had set sail for Europe from neighbouring Libya.
The provincial prosecutor's office has opened an investigation into the death, spokesperson Lassad Horr told AFP.
"It's very likely that they died after being overwhelmed by the fuel fumes at the bottom of the boat," Horr said.
The passengers, all men, came from countries including Bangladesh, Egypt, Pakistan and Syria, he added.
Tunisia and Libya are the main North African departure points for thousands of irregular migrants who risk their lives every year in the hopes of having better lives in Europe.
The International Organization for Migration said 2,498 people died or went missing while trying to cross the central Mediterranean last year, a 75 percent increase on 2022.