The fight was stopped by Gaara, because both combatants may have lost their lives. Sasuke was using both his susanoo and his blaze release, both which were damaging his body and his chakra. A, on the other hand, was using his lightning release armor, but already sacrificed an arm. The position that both of them were in before Gaara stopped them was Sasuke on the floor preparing to launch kagutsuchi upwards, and Raikage coming downwards with a lightning armored axe kick. Considering that kicks are stronger than punches, and a chop was able to get through susanoo's defense, I believe that the downward, lightning enhanced, high speed kick from the powerful A would have most certainly gone through Sasuke's defense and probably bifurcated him. On the other hand, Sasuke's upward shooting spears of black fire would have pierced and burned A all over his body with inextinguishable flame, killing him as well.
Gaara, as well as Kishimoto, knows that both A and Sasuke have similar, stubborn personalities, so they had to be stopped from completing their suicidal attacks.