The Saints fielded a strong side with the likes of England internationals Ben Foden, Chris Ashton, Hartley and Courtney Lawes, but still trailed the Welsh outfit 19-10 at the break.
The Ospreys, with fly-half Matthew Morgan controlling the game, were twice reduced to 14 men in a bad-tempered first half.
But they withstood much of the pressure and Morgan kicked four penalties before the break, while centre Sonny Parker intercepted a Vasily Artemyev pass to score on the stroke of half-time.
Northampton responded after the restart, however, as Calum Clark added to Hartley's double and Artemyev's first-half score to turn the contest around.
The Ospreys took a 6-0 lead with penalties for Morgan on five and 13 minutes before the Saints got on the board through a Ryan Lamb three-pointer after Ospreys captain Tom Smith was sin-binned for throwing a punch.
And five minutes later a driving maul set up a try for Artemyev, who scored a hat-trick against Saracens last week, to give Northampton a 10-6 lead.
But the Saints could not keep the lead for long as Morgan put over two penalties to edge the home side ahead.
And even after scrum-half Tom Habberfield was shown the yellow card for obstruction on 35 minutes, the Ospreys finished the half the stronger as Parker ran in from 60 metres out.
The Ospreys were still down to 14 men at the start of the second half and this time the Saints capitalised, with Hartley going over from a line-out drive shortly after the restart.
And the power of their pack gradually wore the Ospreys down, leading to two converted tries in as many minutes.
First Hartley crashed over for his second of the match before flanker Clark was put over on the right-hand side courtesy of a pinpoint kick from Lamb.
Morgan did put over a fifth penalty on 62 minutes but the losing bonus point was taken away from the Welsh outfit when Stephen Myler slotted over a penalty in the final minute.
Gilbert has released a new line of rugby cleats. The Gilbert Virtuo 8S is part of the exciting new product. Check it out.
The entire All Blacks apparel line has been updated for 2013/14. Check out the New Zealand All Blacks polo.
The Nike Tiempo is a solid rugby cleat and one of few styles still made from full-grain natural leather.
The Gilbert Blitz 8S rugby cleat is a great cleat at a great price of $69.99. Get a new pair of cleats today.
A cool looking all black rugby cleat with the high performance adidas is known for. Get in the Gear!
Wear the crest of the British and Irish Lions on your t-shirt. A great look for the summer.
The All Blacks Performance t-shirt is black with hints of blue from the training jersey. Very Cool.
The New Zealand All Blacks training jersey for 2013/14. Get in the Gear!
The USA Rugby Pro Alternate rugby jersey is perfect for any fan of the Eagles. Get yours to wear during the summer Test matches.
The NEW All Blacks 2013/14 jersey has arrived at World Rugby Shop. Dare to wear the colors of the All Blacks.