Pictures posted on the internet by local residents showed a charred truck and several other scorched vehicles on both sides of the road in the Ezwaiya area of Bent Bayya municipality.
Three medical sources said five bodies were found burned either inside or near vehicles, adding the death toll was expected to rise as there were serious cases among the injured.
It was not clear if the driver of the truck was among the victims.
"The truck was involved in a traffic accident and overturned," a security source told Reuters.
The source said that after the truck overturned but before it caught fire some people from other cars had approached to try and take fuel from the truck's tank.
"(Those) citizens approached it to refuel without realising the magnitude of the danger," the source said.
"Unfortunately, the fire broke out in the truck and resulted in the casualties."
Libya has suffered a fuel shortage since 2014 when the country was divided by a civil war in which rival factions are battling for power following an uprising that toppled long-time leader Muammar Gaddafi in 2011.
In many cities citizens have to wait in long queues, sometimes for hours, to refuel their vehicles.
Abdulhamid al-Dbeibah, prime minister of the Tripoli-based Government of National Unity, said in a tweet that authorities were "closely following the disaster in Bent Bayya municipality".
Dbeibah said instructions were given to transfer the injured people to major hospitals.