Oldham earns controversial replay
The striker substitute who scored twice in the previous round to see off Liverpool was at it again with a towering header deep in stoppage time.
Jordan Obita gave the League One strugglers the lead but the 2009 FA Cup runners-up and last season's semi-finalists struck back thanks to goals from Victor Anichebe and Phil Jagielka before Smith's late intervention.
The home side started on the front foot and stunned their opponents by taking the lead after 13 minutes.
Lee Croft made the initial break down the right after a poor challenge by Leon Osman before his low measured ball into the box was slotted into the back of the net by the on loan Reading midfielder Obita.
However, Everton struck back 11 minutes later as Victor Anichebe cleverly collected Nikica Jelavic's knock down by nudging Jean Yves Mvoto off the ball and smashing his shot beyond Dean Bouzanis.
Minutes later, the Latics came close to restoring their lead when the lively Obita saw his effort narrowly touched on to the far post by Tim Howard.
The Toffees went ahead three minutes after the interval thanks to a rare goal from Jagielka.
Kevin Mirallas' corner kick was headed home from close-range by the England defender after some poor defending by Lee Barnard and a woeful attempt of a punch by goalkeeper Dean Bouzanis.
Caretaker manager Tony Philliskirk then sent on Smith with time running out and he sent the home fans into ecstasy as he climbed above his own goalkeeper Dean Bouzanis in the visitors' box to head the corner into the back of the net deep in stoppage time.