Gloucester (9) 26
Allen's try put Gloucester into the lead for the first time
Tries: Allen, Simpson-Daniel
Cons: Lamb, Paterson
Pens: Lamb 3, Paterson
Ospreys (12) 18
Tries: Parker 2
Pens: Hook 2
Gloucester stretched clear at the top of Pool Two as they beat the Ospreys in a Heineken Cup cracker at Kingsholm.
The visitors had the upper hand in the first 40 minutes and scored two tries through Sonny Parker, but Ryan Lamb landed three penalties for Gloucester.
The hosts went ahead through an Anthony Allen try soon after the re-start.
James Hook edged the Ospreys back in front but James Simpson-Daniel cruised over and Chris Paterson converted and added a penalty to wrap up victory.
Gloucester handed the Ospreys an early lead after the Cherry and Whites tried a repeat of the flowing move from their own 22 which saw Mike Tindall romp over for a superb score against Ulster last week.
Lamb, one of England's battery of promising young fly-halves, played his part to perfection with an accurate long-range pass for Tindall to run onto but the England centre fired a shocking pass behind Iain Balshaw.
Nikki Walker and James Hook were on hand to feed Parker and two percussive hand-offs later the Wales centre was over for the first try of the night.
Hook converted from wide out and although Lamb soon had the hosts on the board with a penalty, they came within inches of conceding their second try within five minutes.
Gloucester made a real mess of the re-start and Gavin Henson - who did his chances of a Wales recall no harm - and Ian Evans gave Jonny Vaughton a run at the corner.
He looked odds-on to score but Balshaw's sprawling tackle just saw the winger put a foot in touch before he dotted the ball down.
It was a big let-off for Gloucester and they soon had two more as the Ospreys failed to make the most of their early dominance, with Hook missing with a drop-goal and a penalty.
However, the Welsh side extended their lead after 23 minutes as Parker barged his way through tackles from Carlos Nieto and Rory Lawson to score.
Sonny Parker's two tries were not enough for the Ospreys
Hook missed the very kickable conversion but although Lamb failed with an equally gettable penalty for Gloucester, they managed to cut the gap to just three points at the break.
Akapusi Qera had produced a storming 40 minutes for Gloucester and when he was quickest to react at a line-out it took a superb tackle from Vaughton to prevent the Fijian flanker from powering over.
However, Vaughton infringed at the resulting ruck, receiving a yellow card for his troubles, and Lamb ensured the Ospreys only led 12-9 at the interval.
It was a poor reward for their efforts and they paid the price within two minutes of the re-start as Allen stepped through the Ospreys midfield defence and raced over from halfway.
Lamb converted, and although the momentum swung back to the Ospreys as two Hook penalties saw them regain the lead, the hosts were soon back in front.
When they lost Nieto to the sin bin it looked like it might prove crucial.
However, Balshaw ran back a poor kick and found acres of space before Simpson-Daniel cruised over for a superb counter-attacking score which Paterson, on for Lamb, converted.
Gloucester dominated territory in the final 20 minutes and a penalty from Paterson ensured that the Ospreys went home without even a losing bonus point.
Gloucester boss Dean Ryan:
"I thought our composure and understanding of how to close the game out was crucial.
"The margins are so tight in this tournament you have to ensure you don't expose yourselves to making mistakes.
"At 12-9 down, we hadn't had much of the game and we were lucky to be that close at half-time."
Ospreys coach Lyn Jones:
"We had the game in the palm of our hands, but we lost control and conceded a couple of key turnovers. We are bitterly disappointed not to win.
"The boys are devastated in the dressing room - not to have won that game is mystifying.
"These games are close affairs, and we lost control a little bit in the second half. Conceding 26 points is unusual for us."
Gloucester: Balshaw, Simpson-Daniel, Tindall, Allen, Vainikolo, Lamb, Lawson, Wood, Azam, Nieto, Buxton, Bortolami, Strokosch, Qera, Narraway.
Replacements: Paterson for Lamb (56), Titterrell for Azam (66), Califano for Strokosch (61), Delve for Qera (45). Not Used: James, Prendergast, Morgan.
Sin Bin: Nieto (54).
Ospreys: Byrne, Walker, Parker, Henson, Vaughton, Hook, Phillips, D. Jones, Bennett, A. Jones, Gough, Evans, Thomas, Holah, Tiatia.
Replacements: Marshall for Phillips (66), James for D. Jones (73), Hibbard for Bennett (73), Wyn Jones for Gough (59), Connor for Marshall (76). Not Used: T-Pole, Taylor.
Sin Bin: Vaughton (40).
Referee: George Clancy (Ireland).