Gloucester eventually overhauled a James Hook-inspired Perpignan as Jonny May's 74th-minute try decided their Heineken Cup opener at Kingsholm.
Hook, out of favour with Wales, converted his own try in the first minute and his kicking put the French back in front after Jimmy Cowan's try.
But May crossed after seeing an earlier try disallowed to put his side ahead before Perpignan's Lifeimi Mafi was sent off for a tip tackle.
Billy Twelvetrees added a late penalty.
After Edinburgh, bottom of the Pro12, had upset Munster in Pool Six's other match earlier in the day, it was the French side who looked likeliest to take advantage for much of the match, with full-back Hook in superb form from the first minute.
The 28-year-old, who played a peripheral role in this year's Six Nations and was left out of a second-string Wales squad's summer tour of Japan, slid over after 57 seconds following an astute kick from Camille Lopez.
Gloucester, led out to a tremendous Kingsholm reception by Olly Morgan after the former full-back's retirement announcement earlier in the week, had been forced into a late change with fly-half Freddie Burns unwell.
Twelvetrees stepped in to deputise, but barely saw the ball in an opening 10 minutes dominated by the visitors.
The Cherry and Whites, rarely posed a threat beyond occasional glimpses of danger from James Simpson-Daniel, but Twelvetrees kept them in touch at 10-6 down with two penalties.
They could have gone into the break level if Cowan not been held up over the line, but had to settle for another Twelvetrees kick and a four-point deficit that was more representative of the half's action.
The hosts went ahead for the first time in the wake of Nicolas Durand's yellow card as Cowan burst between two defenders for an opportunistic try, but Hook's reliable kicking put Perpignan 19-16 up in the wake of Gloucester losing Matt Ksevic to the sin bin.
Hook notched a drop-goal to complete a full house of scores, before Twelvetrees landed another penalty to set up a dramatic final 10 minutes.
May saw his first set celebrations cut short as the video official spotted a forward pass by Mike Tindall earlier in the move, but scampered over soon after to get the Shed rocking.
This time the video official's review of the build-up revealed only Mafi's dangerous tackle on Ryan Mills for which the Tongan deservedly saw red.
The former Munster centre then had to watch from the sidelines as Twelvetrees converted a late penalty with the last kick of the game to cap the win.
VIEWS FROM THE DRESSING ROOM
Gloucester head coach Nigel Davies told BBC Radio Gloucestershire:
"There was an air of frustration within the group this week on the back of our last performance at Kingsholm [against Exeter]. I felt that they really wanted to put things right and they've certainly done that today.
"I was delighted with the fact that our boys came through strong today and particularly in the scrum area and forwards really took the game to what was a monster jumbo pack.
"Quite a lot of players who weren't involved today will to have to go out there and front up that their ready for it. They'll watch what the boys did today and they'll know the standard that was set today. It's a very special night and a special performance, I'm delighted with the players and how they bounced back from last week."
Gloucester: Cook, May, Tindall, Mills, Simpson-Daniel, Twelvetrees, Cowan, Y. Thomas, Edmonds, Knight, Stooke, Hudson, Savage, Kvesic, Kalamafoni.
Replacements: Robson for Cowan (62), George for Edmonds (55), Murphy for Knight (22), Qera for Kvesic (63), Evans for Kalamafoni (63). Not Used: Harden, Sharples, M. Thomas.
Sin Bin: Kvesic (52)
Perpignan: Hook, Mjekevu, Benvenuti, Mafi, Guitoune, Lopez, Durand, S. Taofifenua, Guirado, Ion, Leo, R. Taofifenua, Purll, Strokosch, Narraway.
Replacements: Duvenage for Mjekevu (49), Marty for Lopez (55), Pulu for S. Taofifenua (55), Terrain for Guirado (62), Jgenti for Ion (41), Charteris for R. Taofifenua (62), Perez for Narraway (67). Not Used: Michel.
Sin Bin: Durand (42)
Sent Off: Mafi (76)
Ref: Leighton Hodges (RFU)