The hosts took an early lead when Johnny May charged down the Toulouse back line to touch down after three minutes. Freddie Burns was successful with the conversion.
However, the French side soon took over as Thierry Dusautoir and Timoci Matanavou both showed excellent bursts of pace to score two tries in ten minutes. Lionel Beauxis was on target with the conversions as well as a penalty to give Toulouse a 17-7 lead.
Akapusi Qera pulled a try back for Gloucester, converted by Burns, to make the scores 14-17 at the break.
The home side came out strong for the second half as Charlie Sharples snuck in to score a try just before the hour. Burns again made the conversion before a penalty gave Gloucester a 24-17 advantage.
As Toulouse increased the pressure going into the final quarter of the match, Manatavou was allowed to creep in the corner for his second try of the match, with Beauxis successfully converting to level the match at 24-24.
It took until six minutes from the end for Gloucester to get their noses back in front as Burns fired over a penalty before May's second try of the match, converted by Burns, sealed the win.