The quake occurred at 22:30 GMT on Sunday, at a depth of about 80 kilometers (50 miles).
The epicenter was located about 153 kilometers southwest of the city of Pematangsiantar in North Sumatra, EMSC said. The city has a population of around 209,000 people.
There were no immediate reports of any casualties or damage. Indonesia’s Meteorology, Climatology and Geophysics Agency did not issue a tsunami warning due to the earthquake.
Indonesia is in the "Ring of Fire" area of the Pacific Basin, named for its high concentration of fault lines and volcanos that make earthquakes a frequent occurrence.
In November, a 5.6 magnitude quake hit Indonesia's West Java region, killing more than 300 people in Cianjur City.