The first half ended `with both sides failing to hit the back of the net.
The visitors broke the deadlock in the 61st minute through Matthew Warburton to put the Swans fans on tenterhooks.
Andre Ayew was brought on to replace Kristoffer Peterson and he would change the complexion of the match in favour of Swansea City.
The 29-year-old drew the hosts level just eight minutes following his introduction, before George Byers' gave them the lead.
And Andre Ayew put the game beyond the reach of Northampton, scoring from another header.
The goal was Ayew’s first for the club in more than three years.
Andre Ayew has been linked to several European clubs after the English transfer window was closed.