Behind throughout to an exceptionally durable, smart and disciplined Sale side, Gloucester gathered themselves for one last onslaught that came down to a series of line-out shootouts on Sale's line.
A succession of heavy-duty drives were held by Sale but after Chris Jones and Andrew Sheridan were sinbinned for offences carried out in depths - both in added on time - referee Roy Maybank awarded a penalty try to set Gloucester on their way.
It was a quite extraordinary match. It began in near-farcical conditions of torrential rain and ended in drama of such tension that the entire main stand seemed transported to the far right corner of the field during the frantic late minutes.
Sale will be livid because they had the game well within their compass and after the conditions had prompted a fumble from Ludovic Mercier, Sale cut forward through Andy Titterrell and Jason White before Jason Robinson created room for Sebastien Chabal to score from close range after 23 minutes.
Gloucester were kept in touch with Mercier's boot but Sale were the more structured and scored a try of glorious simplicity just before the break. Chabal broke blind off a scrum and sent Mark Cueto home from the 22 metre line.
The home side finally hit back after Haydn Thomas and James Forrester sustained a move across the face of the posts and hugely physical Olivier Azam bundled over to cut the gap to 11-12.
But Sale nudged ahead 18-11 thanks to two Daniel Larrechea penalties but Mercier's successful strike after 66 minutes cut the gap to 18-14.
It set up the barnstorming finish that was down to the power of Gloucester's forwards to secure four priceless points.