Tindall (R) produced an impressive display for Gloucester
Gloucester 19 (7)
Tries: Penalty, Califano, Foster
Cons: Walker, Lamb
Leinster 13 (7)
Pens: Contepomi 2
Leinster have probably missed out on a home Heineken Cup quarter-final after losing to battling Gloucester.
The home side started well and went ahead through a penalty try although Brian O'Driscoll's simple score levelled the match at 7-7.
Leinster's Felipe Contepomi added a penalty after the break but Gloucester dug in and Christian Califano and Mark Foster both crossed to seal victory.
Contepomi kicked a late penalty for what could be a vital bonus point.
Gloucester did not have anything to play for but, led by the storming performance of skipper Marco Bortolami, they put pool winners Leinster on the back foot from the off.
But poor handling, admittedly in dreadful conditions, meant they could not get the points their pressure deserved.
Fly-half Willie Walker had a great chance to put his side ahead but he missed a simple penalty attempt after 10 minutes.
Horgan's injury is a major worry for Ireland ahead of the Six Nations
And Gloucester were handed a real advantage soon after when Leinster skipper O'Driscoll, after his side had received numerous warnings, was sin-binned for slowing the ball down.
On 20 minutes the home side were awarded a penalty try when Leinster were penalised for bringing down a rolling maul on the try-line.
The visitors started to get back into the game and after Gloucester scrum-half Peter Richards was yellow carded for a second show of dissent, they looked the more threatening.
Contepomi was denied a try by the video referee for losing control of the ball as he dived over before O'Driscoll put his side on the scoresheet with the simplest of tries after a great break from Stephen Keogh.
Leinster started the second half brightly and substitute Robert Kearney was harshly denied the opportunity to score when play was brought back for crossing.
Contepomi added another three points but, boosted by some superb impact substitutions, Gloucester went for the jugular.
Replacement Califano was particularly effective in the loose and the tight and he scored a deserved try on 66 minutes from a driving maul.
And Gloucester went further ahead when Mark Foster collected his own kick through to touch down, although the try was only awarded after lengthy consultation with the video referee.
Leinster claimed a bonus point deep into injury time after Contepomi's penalty which seemed to matter little to the noisy Kingsholm faithful.
Ireland will also be concerned by the serious-looking injury to Leinster wing Shane Horgan, who limped off the field at the end of the first half.
Gloucester head coach Dean Ryan:
"We went into our first two Heineken Cup games against Leinster and Agen unbeaten in the Premiership and there was an enormous amount of hype around this side.
"We knew this group wasn't immediately going to go toe-to-toe with the best players in Europe but we strongly believe they will get to that level and I think we're showing signs of that.
"It hurts that we're out of the tournament and we've got to learn.
"The lessons only apply to the Heineken Cup because some of the way the game is interpreted in the competition is vastly different to the way it is interpreted in the Premiership. That's something we've got to try and adapt to."
Leinster head coach Michael Cheika:
"I told them before the game that if we didn't get something out of it we wouldn't win the Heineken Cup.
"Gloucester played well and it was always going to be a difficult game down here. I think we need to look at our finishing again.
"Things didn't go our way with 20 minutes to go, but we will do everything in our power 24/7 to put things right.
"We're down, but we're definitely not out."
Gloucester: Balshaw; Bailey, Adams, Tindall, Foster; Walker, Richards; Wood, M Davies, Nieto, Bortolami, Brown, Buxton, Hazell, Balding.
Replacements: Keil for Tindall (75), Lamb for Walker (41), Lawson for Richards (71), Califano for Wood (56), Azam for M Davies (56), James for Brown (53), Boer for Hazell (65).
Sin Bin: Richards (24).
Leinster: Dempsey; Horgan, O'Driscoll, D'Arcy, Hickie; Contepomi, Whitaker; Wright, Jackman, Green, Hogan, O'Kelly, Keogh, Gleeson, Heaslip.
Replacements: Kearney for Horgan (39), Corrigan for Wright (61), Blaney for Jackman (57), Finegan for O'Kelly (50).
Not Used: Jowitt, Easterby, Warner.
Sin Bin: O'Driscoll (13)
Ref: Nigel Owens (WRFU).