Swindon took the lead 3 minutes into the second half with a goal from 6 yards out from Billy Paynter.
Lee Peacock came close with a shot hitting the bar. Swindon also had a goal disallowed after a hot from close to the half way line, but the whistle had already blown.
On 61 minutes Simon Cox made it 2-0 with a close range shot after help from the recently recalled Michael Pook.
Deep into stopage time Coke scored for Northampton to make it 2-1, but it was too late to effect the game too much.
Overall a much needed and desevered win which means Malpas can hold onto his job for a bit longer at least. This was Swindon's first win since the end of August.