|Gloucester (15) 39|
|Tries: Marshall 2, Hibbard, Trinder, Twelvetrees Cons: Burns 4 Pens: Burns 2|
|Sale (12) 30|
|Tries: James, Phillips, Longbottom, McGuigan Cons: MacGinty 2 Pens: MacGinty 2|
Tom Marshall scored two tries to help Gloucester maintain their hopes of a top-six finish with victory in a thrilling encounter with Sale Sharks.
Both led in the first half, but Gloucester went in up at the break with Marshall and Richard Hibbard scores.
Sam James and Mike Phillips crossed in the first half for Sharks, who went 24-15 ahead with Byron McGuigan's try.
But tries from Henry Trinder, Marshall and Billy Twelvetrees gave the hosts a bonus-point win.
The result left the Cherry and Whites, in eighth, one point off sixth-placed Harlequins.
However, their other top-six rivals Northampton Saints play Saracens on Sunday.
Gloucester had made the early breakthrough at Kingsholm after a neat interchange between England international Jonny May and Marshall but the hosts allowed their opponents two quick tries, James and the soon-to-retire former Wales international Phillips capitalising on lax defence.
Hibbard, though, put the hosts back in front after scoring off a line-out, before the scoreline turned in Sale's favour once more when AJ MacGinty set up Kieran Longbottom for a try and good play from number eight Josh Beaumont out on the wing sent in McGuigan.
But Gloucester pulled clear after Trinder was left with an easy finish, and Marshall touched down his second before Twelvetrees rounded off a superb flowing move.
Gloucester interim head coach Jonny Bell: "I'm delighted with the five points but we always make life difficult by hurting ourselves.
"We scored five excellent tries but we gift-wrapped them three or four easy tries and there were too many fundamental mistakes.
"We've probably played better this season and lost. The replacements made a big impact to get over the line today but there is still plenty to work on."
Sale director of rugby Steve Diamond: "Our aim was to come down here and score four tries, which we did, but we should have had at least another point.
"The second one was taken away from us in the last minute with a penalty but we couldn't see any offside for that penalty to be awarded.
"We are what we are and our position in the table reflects it. Week in week out, we are inconsistent and we are even inconsistent during the course of games."
Gloucester: Marshall; Sharples, Trinder, Atkinson, May; Burns, Braley; Hohneck, Hibbard. Afoa; Thursh (capt), Galarza, Moriaty, Ludlow, Clarke.
Replacements: Matu'u, McAllister, Knight, Savage, Morgan, Vellacott, Twelvetrees, Halaifonua.
Sale: Haley; Solomona, James, Jennings, McGuigan; MacGinty, Phillips; Harrison, Webber, Aulika, Evans, Ostrikov, Neild, B Curry, Beaumont (capt).
Replacements: T Curry, Flynn, Longbottom, Nott, Pearce, Mitchell, Bedlow, Charnley.
For the latest rugby union news follow @bbcrugbyunion on Twitter.