Timoci Nagusa scored two tries as Montpellier ended Toulouse's unbeaten home record in the Top 14 this season by winning 31-29 at Stade Ernest Wallon on Sunday.
Both sides came into the game on the back of defeats and it was Montpellier who responded by claiming a tense victory to move just three points behind their opponents in sixth place.
Jean-Marc Doussain could have salvaged a point in the eighth minute of added time after a try from Timoci Matanavou, but the fly-half missed his conversion in a dramatic finale.
Wing Nagusa went over twice in the first half to give Montpellier a 21-10 lead at the break and Paul Willemse also went over for Jake White's side early in the second half with Florian Fritz in the sin bin.
Paul Perez and Luke McAlister scored tries in the space of five minutes to get Toulouse back in it, but the home side were unable to avoid defeat, despite Matanavou's late score as Doussain failed to add the extras.