Worcester secured Gallagher Premiership safety – and Gloucester reached the play-offs – after Warriors won an enthralling tussle 27-20 at Sixways.
Worcester's victory put them 11 points clear of bottom club Newcastle with two games left, and the Falcons will be relegated if they do not beat Gloucester next weekend or Leicester beat Harlequins on Friday.
Danny Cipriani ran the show for Gloucester before he went off after 57 minutes nursing a hand injury, being heavily involved in creating first-half tries for wing Henry Purdy and scrum-half Willi Heinz.
The Gloucester fly-half has been overlooked at Test level this season, but watching England boss Eddie Jones would struggle not to have been impressed by Cipriani's classy display.
It proved in vain for his team, though, as despite Purdy claiming his second try and Billy Twelvetrees kicking a penalty and conversion, Worcester triumphed through touchdowns for fly-half Duncan Weir, hooker Niall Annett and lock Darren Barry.
Weir also booted two penalties and three conversions for a 17-point haul, while Gloucester's losing bonus point put them into the play-offs for a first time since 2011.
Worcester wing Perry Humphreys returned after injury, replacing a suspended Bryce Heem, while Gloucester showed four changes following victory over Bath two weeks ago, including starts for ex-Warriors prop Val Rapava Ruskin and flanker Jake Polledri.
Weir kicked Worcester into a sixth-minute lead after Warriors' Wales wing Josh Adams went close to breaching Gloucester's defence, but the visitors hit back in impressive fashion.
Cipriani's clever kick into space put the Worcester defence on the back foot, then possession was moved quickly before Cipriani sent Purdy over for the touchdown.
Worcester, though, rocked their opponents through a 10-point scoring burst in just three minutes, with Weir collecting the lot.
A long-range penalty edged the Warriors back in front, then his defence-splitting pass sent Humphreys clear, and although he was hauled down just short of the line, he got a pass away to Weir.
The Scotland international finished off an impressive move, before he added the conversion and opened up a 13-5 lead inside the first 20 minutes.
Gloucester enjoyed territorial supremacy for the remainder of an entertaining half, but it took them until the dying seconds to break down Worcester's defence.
And Cipriani was inevitably the catalyst, twice being involved in a move studded by precision passing, and centre Mark Atkinson's final ball to Heinz sent the Gloucester skipper over.
Twelvetrees added the conversion, giving Gloucester a two-point interval advantage as they closed in on the play-offs.
But Worcester regained the lead 10 minutes after half-time after their forwards battered away at Gloucester's line before Annett crashed over.
Weir's conversion made it 20-15, and Gloucester were fortunate to see lock Ed Slater avoid punishment following a shoulder-led challenge on Adams that left the Worcester player requiring treatment.
Worcester's forwards relished the challenge in front of them, and they scored again six minutes later when Barry rounded off another spell of sustained pressure.
Gloucester, without Cipriani, needed to rally in the final quarter, and they began it well through a second touchdown for Purdy after he collected fellow wing Charlie Sharples' long floated pass.
But they could make no further in-roads as Worcester held out for a deserved victory that means they will be playing top-flight rugby again next season.
ga('create', 'UA-72310761-1', 'auto', {'name': 'pacontentapi'});
ga('pacontentapi.set', 'referrer', location.origin);
ga('pacontentapi.set', 'dimension1', 'By Andrew Baldock, Press Association Sport Rugby Union Correspondent');
ga('pacontentapi.set', 'dimension2', '8bd71272-782b-45ef-8cde-7eb032b79c48');
ga('pacontentapi.set', 'dimension3', 'paservice:sport,paservice:sport:uk');
ga('pacontentapi.set', 'dimension6', 'story');
ga('pacontentapi.set', 'dimension7', 'composite');
ga('pacontentapi.set', 'dimension8', null);
ga('pacontentapi.set', 'dimension9', 'sport:rugby-union');
ga('pacontentapi.send', 'pageview', { 'location': location.href, 'page': (location.pathname + location.search + location.hash), 'title': 'Worcester clinch survival as Gloucester secure play-off spot despite defeat'});