A security official who declined to be named said that, in an assault lasting several hours, the attackers overwhelmed the soldiers' position before reinforcements took it back.
Local authorities and inhabitants have blamed the attack on militants.
The army gave a "provisional toll" of six dead and several wounded, without giving further details.
The security official, however, said seven soldiers had been killed.
Mali has been struggling to contain a militant insurgency that erupted in the north in 2012 and has claimed thousands of military and civilian lives since.