A delightful Barrie McKay goal handed St Mirren a first defeat in seven games and strengthened Hearts’ hold on third place in the Scottish Premiership.
McKay drove at the visitors and finished a fine move to cleave open a six-point gap over Aberdeen.
However, the hosts, who had boss Robbie Neilson red carded, had to cling on while under intense pressure late on.
Jonah Ayunga hit the post and Zander Clark made a superb double save from Greg Kiltie to guard Hearts’ lead.
St Mirren boss Stephen Robinson will also be aggravated at his team not being awarded a late penalty when the ball struck Hearts defender Kye Rowles on the arm inside the penalty box.
The Tynecastle defeat means the visitors miss the chance to move up from sixth to fourth in the table.
St Mirren had shown ambition early in the match when Curtis Main’s cross flashed past the head of his fellow attacker Alex Greive six yards from goal.
Main and Keanu Baccus also tried their luck before Hearts found their rhythm, so often prompted by the influential midfielder Robert Snodgrass and with Alex Cochrane ever eager to advance down the flank.
McKay proved to be the difference between the teams, his goal beautifully worked. He picked up possession in his own half and drove at the St Mirren defence, drawing three black and white jerseys towards him before playing a one-two with skipper Lawrence Shankland, then a one-two with Andy Halliday, whose lay-off was perfectly weighted for McKay to sweep home from the edge of the box.
St Mirren looked aggrieved to be behind and fought hard for an equaliser. On occasion, they were too physical as Baccus caught Snodgrass with a late challenge and Declan Gallagher made a cynical block on McKay as he galloped down the left wing.
After Andy Halliday had blazed over the bar from Cochrane’s drive into the box, Kiltie did likewise at the other end before he drew a magnificent double save from Clark, the keeper stopping his first effort with his left hand and the second with his right leg.
A measure of the tension in the stadium was Neilson being sent to the stand where he endured the last agonising minutes beside injured goalkeeper Craig Gordon.
And it was a worrying watch for the Hearts boss as Scott Tanser’s ball into the box struck the arm of Rowles, but much to the fury and astonishment of the visiting players, referee David Munro was not summoned to the monitor.
New signing Garang Kuol, came on for McKay for the last 13 minutes and had the fans on their feet as he set up Stephen Humphrys for what ought to have put the result beyond doubt in the 89th minute. However, with only Carson to beat, the striker appeared to stub his foot as he shot wide.
Player of the match – Barrie McKay
St Mirren leave Tynecastle with pride rather than points – analysis
St Mirren should finish in the top six if they carry their second-half performance into the rest of their league campaign. The number of shots that flew wide of Clark’s goal indicates a lack of precision but it took an exceptional act of goalkeeping to deny Kiltie in quick succession.
They matched Hearts in every area of the pitch but had no-one to match McKay in terms of crafting a goal.
Hill looked comfortable on his Hearts debut and the home fans will hope he and Rowles can form a solid partnership straightaway.
Rowles, for his part, might be staring at his bedroom ceiling this evening pondering whether a penalty would be awarded if he handles the ball in the same way again in his next match.
This was a big win for Neilson. Hearts and Aberdeen will drop many more points in their remaining 17 matches of the league campaign, but you feel the gap may be insurmountable for the Dons if Hearts can keep Snodgrass fit and avoid further serious injuries.
What they said
Hearts manager Robbie Neilson: “I thought first half we played really well, controlled the game but second half it became a bit more stuffy.
“It was a great goal. Fans pay money to see their team and they deserve to be excited, first half I feel we excited them.”
St Mirren manager Stephen Robinson: “We contained Hearts in the first half, had numerous breakaways and it’s one bit of quality which wins the game from an excellent footballer.
“It’s difficult to take because it’s hard to pick fault with anybody on that pitch.”
Hearts have another game at Tynecastle in midweek with Aberdeen the league visitors on Wednesday, the same night St Mirren travel to Celtic Park in the Premiership (both 19:45 GMT).