A late winner by the St Johnstone captain, David Mackay, earned all three points for the Perth side after Ross County had fought back from 2-0 down to level at Victoria Park.
David Wotherspoon gave Saints an early lead after he closed down the County goalkeeper, Gary Woods, as he attempted to clear and the former Hibernian midfielder made it 2-0 just before the interval with a fine finish.
County fought back after the break and goals from Liam Boyce and Andrew Davies looked to have rescued a point for the Highland club.
However, with two minutes remaining, Mackay beat Woods with a free-kick from 25 yards out to take the points back to Perth and push St Johnstone to within one point of third-placed Hearts.
Kilmarnock and bottom side Dundee United shared a 1-1 draw, with the home side playing most of the match at Rugby Park with 10 men. The returning Kilmarnock striker Kris Boyd scored in the third minute, when he met Josh Magennis’s cross into the box and lashed home a left-foot shot from close range.
It was the ideal start for Gary Locke’s side, who had been left reeling by last week’s 5-2 defeat at the same venue against Partick Thistle.
Killie went for a second goal and only the woodwork prevented midfielder Tope Obadeyi from increasing their advantage.
Kilmarnock were dominating a United side low on confidence and should have added to their lead – but, instead they found themselves pegged back and a man down after Stuart Findlay was sent off for a foul on Ryan McGowan.
Billy McKay scored from the consequent penalty to give the struggling Tayside club their first point in five games.
In the Scottish Cup third round, Lowland League side East Kilbride knocked out Stenhousemuir thanks to Jack Smith’s second goal of the contest. The League One visitors had Alan Cook sent off after 81 minutes of the replay.
Christopher Templeman scored a 77th-minute winner as First Division Forfar beat the Second Division’s Queen’s Park 2-1. Cove Rangers will play Motherwell in the next round of the Cup after beating their Highland league rivals Formartine United 4-1 in their replay.