Ea Lla Koto came into the match knowing they needed all three points, while also hoping that SuperSport United would do them a favour against Polokwane City to avoid the relegation/promotion play-off tussle.
Stars did their share of the business with a brace from Adam Abdul-Basit and a goal from Ruben Thebekang handing them victory, and they were assisted by SuperSport who beat Polokwane 4-2.
The combined results saw Stars finish 14th on the table with 29 points, two points behind 13th-placed Swallows, and one ahead of Polokwane, who now enter the relegation-promotion playoffs against NFD opposition. Golden Arrows were demoted to the second tier earlier in the week.
The first half produced plenty of shots on goal, but neither team was able to breach the deadlock due to some poor finish.
The start of the second half saw Stars throwing men forward in search of a goal and they came close two minutes after the restart when Katlego Mashego saw an effort on goal from just inside the box superbly saved by Greg Etafia.
Etafia had to be at his best again in the 57th minute when he turned a powerful shot from Danny Venter around the post with a fingertip save.
Seven minutes later Richard Henyekane beat a couple of defenders before shooting on goal from just outside the box, but he saw his effort shave the wrong side of the upright.
Then in a matter of five minutes Stars saved their topflight status with three goals.
First, in the 72nd minute Abdul-Basit turned home a Venter pass to make it 1-0.
Abdul-Basit then completed his brace a minute later, this time expertly scoring from a Henyekane assist.
The result was put beyond doubt in the 77th minute when Thebekang pounced on a loose ball, after Etafia had initially spilt a Venter shot, and he made no mistake from close range.