Inverness had taken the lead in the 49th minute when Andrew Shinnie finished off a move he had started himself, but Hearts fought back strongly and Michael Ngoo netted a debut goal 24 hours after signing on loan from Liverpool.
Scott Robinson was sent off for a two-footed challenge in a full-blooded encounter that also saw nine players booked, but the Gorgie side held on for penalties and Inverness substitute Philip Roberts missed the final spot-kick to spark Hearts celebrations at Easter Road.
Ngoo could not have come closer to getting off the mark in the 25th minute when he battled to meet a Danny Wilson cross and got in a glancing header that came off the inside of the post and was cleared.
Inverness started the second half in the perfect manner when Andrew Shinnie's persistence paid off.
Shinnie had a shot blocked but he soon won it back from Andrew Driver and played it in for Billy McKay. The striker held off Marius Zaliukas and neither could collect the ball, which Shinnie ran on to and slotted just inside the far post.
Hearts levelled in the 66th minute when Webster headed Fraser Mullen's deep free-kick back into the six-yard box and Ngoo volleyed home with his left foot.
Robinson was shown a straight red card in the 77th minute for a two-footed challenge on Owain Tudur Jones.
The game drifted towards penalties with Hearts seemingly content to run the clock down.
The successful conversions kept coming and Mehdi Taouil made it 5-4 before Roberts was handed the first sudden-death pressure shot and blazed over the bar to send the Hearts fans wild.