However, with the game in stoppage time Nick Ross netted ICT's second to take the game to extra time.
Ross Draper spurned a golden chance for Inverness early on when he blazed over inside the penalty area.
Tansey scored the opening goal when he rifled home an effort from outside the box for the visitors after 53 minutes.
Warren was given a red card after he brought down Sam Nicholson on the edge of the box, before Hamill netted the equaliser from the resulting free kick.
Five minutes later Hearts were in front as Hamill grabbed his second of the afternoon with another free kick, this time from all of 25 yards.
Meekings was given his marching orders in stoppage time as the visitors finished the game with nine men, with Ross levelling to send the tie to extra time.
The depleted ICT side held on for half an hour of extra time before overcoming the home side 4-2 on penalties.