Alexander Frei and Marco Streller headed the home side into what appeared a commanding half-time advantage.
But Dmitri Kombarov and Artem Dzjuba drew the Russians level and Xherdan Shaqiri's dismissal meant it was Basle who were left clinging on - and Zhano Ananidze's last-minute free-kick completed the turnaround.
Rafael Carioca and Yevgeni Makeev were off target with long-range volleys for Spartak in the early stages, before Streller headed Frei's cross wide of the left-hand post.
Valentin Stocker met Frei's corner with a volley which was saved by Andrei Dikan before Spartak went close at the other end with a similar effort, Dzjuba's strike gathered by Basle goalkeeper Franco Costanzo.
Rafael Carioca shot over once more before Aiden McGeady was cautioned for fouling Valentin Stocker - who followed him into the book for his reaction - and the resulting free-kick from Frei was fisted away by Dikan.
Basle took the lead in the 36th minute when Frei handed over flag-kick duties to Shaqiri and instead met the delivery at the far post, powering a header into the roof of the net.
And another Shaqiri corner provided a near-identical second five minutes later, Streller this time finding the bottom corner.
The start of the second half saw little by way of goalmouth action, with only bookings for Gilles Yapi Yapo and Rafael Carioca to report before Dzjuba tried his luck on the hour - Costanzo was equal to the effort.
Spartak cut the deficit a minute later, though, with Kombarov curling a delightful effort into the bottom corner from 20 yards.
David Abraham headed a Frei corner over the bar before Spartak levelled in the 70th minute, Dzjuba meeting Alex's cross with a firm finish into the roof of the net from six yards.
Spartak began to lose their discipline after that point, with Frei lucky to escape punishment for a reckless challenge on Ananidze before Shaqiri was dismissed for lashing out at Makeev.
Frei was swiftly replaced by Fwayo Tembo before Alex drew a sharp save from Costanzo.
But the goalkeeper had no answer when Genseric Kusunga's foul on McGeady handed Ananidze the opportunity - and his 20-yard effort found the bottom corner to give Spartak the lead in the tie.
Basle 2-3 Spartak Moscow: Match Report - view commentary, squad, and statictics of the game as it happened.