It was a night of double joy for the Motherwell fans following the news that manager Mark McGhee is likely to miss out on becoming the Scotland manager.
There had been a 10-minute delay to kick-off as a large crowd gathered for Motherwell's first home game since the death of captain Phil O'Donnell.
The home fans' hopes of marking it with a victory suffered a pre-match blow when Steven McGarry took ill just before kick-off.
Jim Paterson, in the middle of a league suspension but free to play in the cup, was the midfielder's replacement.
But, during a tense opening, it was the home side who threatened first and McCormack whipped in a dangerous free-kick that just evaded Chris Porter and the far post.
Michael Stewart had recovered from a stomach complaint to retain his place in Hearts' midfield.
And it was his corner that gave Deividas Cesnauskis a chance from 12 yards, but the winger's prodded effort was cleared a yard from goal by Marc Fitzpatrick.
Jonsson conceded the penalty when the ball struck his hand
But it was the home side who took the lead when Jonsson blocked the ball with his arm as McCormack crossed the ball into the penalty area.
Referee Stuart Dougal immediately pointed to the spot and, after some treatment to Porter, McCormack stepped up to fire the ball high in to the net.
Motherwell dominated the first half thereafter.
Saulius Mikoliunas had come in for Andrew Driver on the wing and the in-form Englishman's absence appeared to adversely affect Hearts' midfield creativity.
Hearts brought Christian Nade on for the ineffective Cesnauskis at the break and the visitors drove at the Motherwell goal with renewed vigour without causing great problems for goalkeeper Graeme Smith.
Motherwell, meanwhile, missed the aerial presence of Porter, who had gone off through injury.
And Hearts missed a great chance when Paul Quinn failed to cut out Jonsson's cross and Velicka cracked the ball off the post from 12 yards with only the goalkeeper to beat.
Nade slalomed past a couple of Motherwell players on the byline before sending in a shot that was saved at the near post by Smith.
The goalkeeper made a brave save at the feet of Nade as McGhee's side progressed to the fifth round.
Motherwell: Graeme Smith, Quinn, Craigan, Reynolds, Paterson, Hughes, Lasley, Fitzpatrick, Clarkson, McCormack, Porter (Darren Smith 45). Subs Not Used: Meldrum, Brian McLean, Archdeacon, Murphy.
Bookmark with:
What are these?