The epicenter of the quake was six kilometers (3.73 miles) northeast of Majene city at a depth of 10 kilometers.
Initial information from the country's disaster mitigation agency showed that four people had died and 637 others were injured in Majene, while there were three more fatalities and two dozen injured in the neighboring area of Mamuju.
Thousands had fled their homes to seek safety when the quake hit just after 1 am local time on Friday morning, damaging at least 60 homes, the agency said.
The quake was felt strongly for about seven seconds but did not trigger a tsunami warning.
Videos on social media showed residents fleeing to higher ground on motorcycles, and a child trapped under the rubble as people tried to remove debris with their bare hands.
Some buildings were badly damaged, including two hotels, the office of the governor of West Sulawesi and a mall, Sudirman Samual, a journalist based in Mamuju, north of the epicenter, told Reuters.
At least one route into Mamuju had been cut off, he said, due to damage to a bridge.
Hours earlier on Thursday, a 5.9-magnitude earthquake struck in the same district damaging several houses.
Indonesia's disaster agency said a series of quakes in the past 24 hours had caused at least three landslides, and the electricity supply had been cut.
Straddling the so-called Pacific 'Ring of Fire', Indonesia, a nation of high tectonic activity, is regularly hit by earthquakes.
In 2018, a devastating 6.2-magnitude quake and subsequent tsunami struck the city of Palu, in Sulawesi, killing thousands of people.