Derek McInnes' side were reduced to 10 men when centre-back Craig Halkett was sent off in the 29th minute for denying St Mirren debutant Jacob Devaney a goalscoring opportunity.
It was the third time in five league games the Jambos had been reduced to 10 men.
Unlike the previous two occasions, however, Hearts were unable to emerge unscathed in Paisley as Miguel Freckleton's 88th-minute header from Declan John's corner consigned them to their third defeat of the season.
The defeat leaves Hearts six points ahead of second-placed Celtic and third-placed Rangers.
The Glasgow clubs play their games in hand on Wednesday, with Celtic travelling to Aberdeen and Rangers hosting Kilmarnock.
