The two sides will contest the Scottish League Cup final next month - and Danny Lennon's side struck a psychological blow ahead of that contest with this comfortable victory.
Paul McGowan netted from the penalty spot after three minutes and Carey's impressive breakthrough extended their lead on the stroke of half-time.
Saints made a good start to the match and earned two early corners, the first of which was headed behind by Darren Barr.
Barr was involved in the next corner too and this time he was adjudged to have felled Lee Mair, resulting in referee Kevin Clancy pointing to the spot.
McGowan stepped up to take the resulting kick and duly despatched the ball past goalkeeper Jamie MacDonald, who dived the wrong way.
Hearts responded at the other end and Craig Samson had to parry away Jamie Walker's fizzing shot on the angle.
Barr received the first booking of the match for carelessly fouling Carey, before David Ngoo worked Samson with a low shot from the edge of the box.
However, it was the hosts who looked the more likely to add to the scoring and Sam Parkin should have done better when he met Carey's delivery.
On the stroke of half-time St Mirren did manage to double their lead and it came in stunning fashion, Carey looping a shot over the helpless MacDonald from 25 yards out.
Hearts boss John McGlynn introduced John Sutton and Dylan McGowan in place of Ardvydas Novikovas and Barr for the start of the second half.
Carey could not beat MacDonald with a second strike from distance on 56 minutes and Hearts had their best chance of the opening hour when Samson parried Walker's shot to Sutton, who could not quite turn the ball into the net.
After offering very little in the way of attacking threat in the first half, the double substitution at half-time seemed to breath new life into the visitors, although they continued to find scoring opportunities difficult to come by.
Kevin McHattie had a drive from distance in the final minute of injury-time comfortably gathered by Samson and St Mirren held out to leapfrog their opponents in the table.