Manager David Moyes left the Australia international on the bench as one of six changes to his starting line-up but was forced to call on the midfielder as League One Luton - the lowest-placed side left in the competition - held out for extra-time.
And Cahill, who only made his first appearance of the season last week after a foot injury, struck in the 101st minute as Everton made the last eight of a cup competition for the first time under Moyes.
Fellow substitute Thomas Gravesen's corner flicked the head of Town defender Jaroslaw Fojut to the far post where Cahill was lurking to prod the ball past the helpless Dean Brill.
"He's got a fantastic knack of being in the right place at the right time and when the ball finds him in those places he's composed enough to find the net," said Everton No2 Alan Irvine.
"In the first half we were disappointed. We didn't play well, we didn't pass the ball well.
"But in the second half we created chances and should really have finished the game off.
"It's all about the result - you'll take any result to get into the quarter-finals and we'll take any result in the next round as well.
"But it was no surprise how well Luton played, we knew it would be a tough game. Luton have a very good home record and we knew it was going to be a difficult place to come."