Brighton took the lead on 38 minutes with a header from Adam Virgo beating Phil Smith.
Swindon equalised two minutes into the second half with a close range goal by Gordon Greer.
On 50 minutes Swindon were in front after a Cox shot had only been half saved, and Billy Paynter was on hand to score with the rebound.
Swindon's third goal was scored on 58 minutes by Simon Cox making it 3-1.
With a couple of minutes left Brighton pulled a goal back with a goal from Gary Dicker, but Swindon were able to hold on for the win.
Overall a good win by Swindon who played well. The win keeps Swindon in 17th place, but now with 48 points. One more win this season could be enough to keep Swindon in league One for another year.