Postpublished at 22:36 GMT 17 January
Blair Spittal has the ball in his hands for Hearts.
Watch: St Mirren's winning penalty against Livingston
At a glance
St Mirren beat Livingston on penalties to advance to last 16
Paisley side win for the first time in six matches
Livingston's winless run extends to 21 games
St Mirren squeezed past fellow top-flight strugglers Livingston on penalty kicks to earn their first win in six matches and progress to the last 16 of the Scottish Cup.
Malik Dijksteel netted the decisive spot kick for Stephen Robinson's men - who have been on an abject run since being crowned League Cup winners just over a month ago - as Livi's winless run extends to 21 games.
The two embattled sides will meet again in the Premiership on Tuesday in a relegation showdown (19:45 GMT).
Roland Idowu opened the scoring for St Mirren after just four minutes, when he finished a sweeping move with a smart finish to turn in Jayden Richardson's cross.
However, Livingston responded seven minutes later with a team goal of equal - if not better - quality.
Hometown hero Scott Arfield scored his first goal for the club at the age of 37 after cleverly dummying a pass before latching onto Joshua Brenet's inventive flick and poking the ball beyond Shamal George.
The game did not slow from there. Declan John and Killian Phillips came close before half-time as both sides exchanged blows in a breathless first period.
The second half initially followed a similar pattern; counter-attack after counter-attack, but with deteriorating quality as the players tired.
The hosts wrestled control as the game wore on, with Mahamadou Susoho and Robbie Muirhead coming close before Stevie May failed to convert a one-on-one.
Yet despite that period of dominance, Dan Nlundulu passed up two big opportunities to retake the lead for St Mirren before the end of regulation time.
Substitute Nlundulu then missed a third opportunity in the second half of extra time when his scuffed effort on the six-yard line was blocked and cleared.
The match was eventually decided by penalties, with former Livingston goalkeeper George haunting his old club with an important stop before Dijksteel's winner.
St Mirren take early lead against Livi
Livingston are now 161 days without a win.
This was a familiar tale, another one of 'those days' where they can be commended for a spirited performance but fell short - often a symptom of sides doomed for relegation.
Scottish Cup week offers a welcome break from league action for troubled teams, and Livingston played with a renewed energy and belief, but it wasn't enough. Again.
As their dismal run endures, St Mirren have stopped their mini rot - a first win in six games. And they needed it.
One month on from that famous afternoon at Hampden, they have won just two matches, both against Livingston.
Robinson will be hoping for the same outcome, with an improved performance, when they meet again on Tuesday.
Scott Arfield scored his first goal since returning to Livingston
For the third time in a month - and the second time in four days - this pair meet again on Tuesday (19:45 GMT).
Livingston welcome St Mirren to Almondvale in a rescheduled Premiership match after last week's meeting was postponed due to a frozen pitch.
After the opportunity to rate players has closed, the score displayed represents the average from all the submissions by BBC Sport users.
Manager: David Martindale
Formation: 4 - 2 - 3 - 1
Manager: Stephen Robinson
Formation: 3 - 5 - 2
Manager: David Martindale
Formation: 4 - 2 - 3 - 1
Manager: Stephen Robinson
Formation: 3 - 5 - 2
Scottish Cup
All competitions
All competitions