Goals from Gary Fraser, Lee Mair and Kallum Higginbotham during a 22-minute spell turned the game on its head after bottom-of-the-table Hearts had looked on course to make it five straight wins.
However, it was three well-deserved points for the visitors who created many more chances than the already-relegated hosts.
Despite having the first two efforts on goal, Partick fell behind on 16 when Callum Paterson fired in a low left-foot strike from 12 yards.
And Hearts could have doubled their lead less than three minutes later when Billy King fluffed his lines from inside the box.
At the other end Marc Ridgers saved well from Higginbotham who provided the assist for Lyle Taylor to level matters after half-an-hour.
Taylor then came close to giving the visitors the lead seven minutes later, as his header from 10 yards flew inches wide of the left-hand post.
But it was Hearts who regained the lead five minutes before the break when Kevin McHattie’s free-kick was headed home at close range by Danny Wilson.
However, Partick equalised a second time just five minutes after the break as Christie Elliott found Fraser who lashed home from outside the box and into the top right-hand corner of the net.
On the hour, McHattie flashed a free-kick just wide of the right post but eight minutes later it was Partick who grabbed the lead for the first time when Mair headed home from a corner.
And 18 minutes from time Partick sealed their survival for another season as Higginbotham crashed in the fourth from just inside the box.