The win means Ezenkosi are automatically relegated, while AmaTuks, who beat Golden Arrows 2-1, will go into the play-offs.
The match took place in front of a packed stadium, a large contingent having travelled up to Potchefstroom from KZN to support the visiting side.
And it was Maritzburg who started brightly, Thamsanqa Mkhize failing to find the target with a back-post header from a Philani Zulu cross on 12 minutes, before Thamsanqa Teyise had a header cleared off the line by Linda Mntambo four minutes later.
Having seen off Maritzburg's early threat, Cosmos were to take the lead on 27 minutes when Mntambo's first-time left-footed drive from 25-yards out flew past Virgil Vries and into the bottom corner of the net.
Vries did well three minutes later to make sure the home side did not add a second goal when he came rushing off his line to block Tebogo Makobela's shot. The goal though took the sting out of Maritzburg's efforts and it was Cosmos who looked more comfortable for the final 10 minutes of half time.
The Team of Choice began the second half with more purpose, and only a superb save from Sherwyn Naicker in the 57th minute denied Zulu from scoring with an angled shot towards the top corner before the Cosmos defence were fortunate to escape what seemed a good shout for a hand-ball.
More chances followed as Gregory Maasdorp saw his overhead kick going over the crossbar on 62 minutes. The pressure continued to mount from the visiting team, but Naicker and his defence were on top of things, making some telling interceptions as the ball came into the Cosmos box on a regular basis.
But United's perseverance and persistence was to pay off eight minutes from time when Mohau Mokate's looping header from six yards out found the net.
The second goal was to follow just three minutes later when Abia Nale burst down the right wing before picking out Evans Rusike, who finished clinically with a glancing shot in at the far post.
Rusike ensured there was to be no come-back for Jomo Sono's side when he completed his brace in the third minute of added time, sprinting clear on the break before smashing past Naicker with an angled drive from the right hand side of the box
African News Agency
Original source: Maritzburg in dramatic late escape act