Lawrence Shankland was the hero as 10-man Hearts squeezed past Motherwell at Tynecastle.
Andy Halliday had helped himself to a goal either side of half-time, despite Jorge Grant being shown a straight red card in 38 minutes.
But Louis Moult earned and scored a penalty on the hour-mark and Spittal smashed in Stuart McKinstry's cut-back to draw Motherwell level with 11 minutes left.
It looked like Motherwell were going to escape with a point, but a late penalty for hand-ball saw Shankland bury the winner.
The Steelmen thought they had made quite a stirring fight-back, with Kevin van Veen being denied an earlier equaliser by an offside flag, which VAR confirmed.
The Jambos were reduced to 10 men seven minutes from the interval when Grant was shown a straight red for a crude challenge on Callum Slattery.
But the hosts took the lead right on the stroke of half-time when Andy Halliday headed in a Robert Snodgrass corner.
That was slightly harsh on a Motherwell side that had chances in the first half, with Kevin van Veen twice smashing a shot past the right post when he should have done better.
To be fair, Hearts had two good chances through Lawrence Shankland and Cammy Devlin before bagging their goal, with Liam Kelly making smart saves on both occasions.
But Halliday helped himself to a second with a simple side-foot, and Hearts were seemingly in the driving seat.
However, already-booked Craig Gordon took sub Louis Moult out of the game in 59 minutes to hand Motherwell a penalty, which the striker scored, and Kevin van Veen had a strike ruled out for offside shortly afterwards.
And McKinstry's cross was slammed into the net by Spittal to level in 79 minutes.
However, Shankland had the last say for the Jambos.
Hearts boss Robbie Neilson made five changes to the side that lost 3-1 to Basakshehir in the Europa Conference League on Thursday night. In came Josh Ginelly, Robert Snodgrass, Andy Halliday, Lawrence Shankland and Barrie McKay for Nat Atkinson, Lewis Neilson, Connor Smith, Euan Henderson and Alan Forrest.
His Motherwell counterpart Stevie Hammell kept faith with the side that beat Dundee United 1-0 last weekend.
Hearts' McKay had the first sight of goal in four minutes, but chipped high and wide of the right post from the left corner of the box.
Snodgrass then sent Halliday down the left and his cut-back flew across goal with no takers
Callum Slattery earned a free kick for a trip just outside the box in seven minutes, with Kevin van Veen sending the set-piece just wide of the right post, rippling the side-netting.
Hearts should have scored in 12 minutes when Ginelly was sent down the right and he crossed for Shankland, but Liam Kelly brilliantly diverted his volley past the left post at the expense of a corner.
An injury to Paul McGinn had Motherwell down to 10 men around the 19th minute mark, before Stephen O'Donnell was able to take his place.
Snodgrass sent Halliday down the left in 22 minutes but his shot was punched over by Kelly.
Michael Smith then sent Ginelly down the right and his cross was met by Grant, but it was well blocked two minutes later.
Motherwell thought they had taken the lead in 26 minutes when Stuart McKinstry found space down the left and his cut-back picked out van Veen, but the Dutchman again fired inches wide.
Ginelly was sent through on goal a minute later, but Kelly raced off his line well to clear.
O'Donnell's pass-back left Kelly short in 32 minutes, and he hoofed it in the air, straight to Cammy Devlin, but recovered to save his shot, before he fired the rebound over.
Motherwell nearly took the lead in bizarre circumstances in 34 minutes when a free kick from the right was headed by Ricki Lamie and deflected off the head of Toby Sibbick, bur flew past the left post.
Blair Spittal's cross was then headed wide by Callum Slattery.
Hearts were reduced to 10 men in 38 minutes when Jorge Grant was shown a straight red for a crude challenge on Slattery.
However, the Jambos took the lead right on half-time when Snodgrass's corner from the right was met with a header by Andy Halliday that looped into the right corner of the net.
And they doubled that three minutes into the second half, when McKay raced down the left, piced out Halliday and he fired a low shot into the right corner.
Shankland tried to score a third for Hearts with an audacious attempt from 50 yards after seeing Kelly off his line, but it cleared the crossbar.
Van Veen had another chance to hit the net, but mis-hit his shot and Craig Gordon made a comfortable save.
Motherwell were handed a life-line in 59 minutes when Gordon cleaned out sub Louis Moult as he raced through on goal.
Following a check, the penalty was good, and Moult buried it into the bottom left corner, but was booked for an altercation while retrieving the ball.
Van Veen then had the ball in the back of the net, only to be denied by an offside flag, which VAR then backed up.
But McKinstry's cross picked out Spittal and he finished well to draw Motherwell level in 79 minutes.
However, there was late drama to follow as a cross struck a hand inside the box and Shankland stepped up to bury the penalty into the bottom left corner.
HEARTS: Gordon, M. Smith, Sibbick, Cochrane, Halliday, Devlin, Ginelly, McKay (Rowle, 90), Snodgrass, Grant, Shankland.
Subs (not used): Clark (GK), Kiomourtzoglou, Atkinson, Forrest, Neilson, Henderson, C. Smith, Pollock.
Sent off: Grant (38)
Bookings: Gordon (38), Devlin (73)
MOTHERWELL: Kelly, McGinn (O'Donnell, 20), Solholm, Lamie, Penney, Goss, Slattery, Spittal, McKinstry, Shields (Moult, 55), van Veen.
Subs (not used): Oxborough (GK), Mugabi, Maguire, Cornelius, Morris, Tierney, Miller.
Bookings: Lamie (36), Moult (60), McKinstry (84)
Referee: Kevin Clancy.
Follow Lanarkshire Live Sport on Twitter via @LanLiveSport, like us on Facebook or find us on Instagram for the latest sports news, pictures and video.