There is a sign in the gents toilets at Boundary Park that should prepare visitors to expect the unexpected: "Now wash your mouth out." Certainly Everton were left with a bilious taste after conceding an equaliser in the fifth minute of stoppage time at the end of a humdinger fifth-round tie in the very best traditions of the FA Cup.

Oldham, flirting with relegation from League One, were marvellous, raising their game in time-honoured fashion to earn a deserved replay against opponents sixth in the Premier League. Their hero was again Matt Smith, the latecomer from non-League football who scored twice to see off Liverpool in the last round. This time, half fit and able to manage only half an hour as substitute, the towering targetman used that powerful 6ft 6in frame to level the scores so late that there was barely time for the restart.

The replay at Goodison Park may be worth up to £500,000 to the impoverished Latics but to his great credit the chairman, Simon Corney, preferred to dwell on his team's splendid football, rather than financial matters. "I always find talking about the money a bit of a shame," he said. "I was asked about it after the Liverpool game, then again when we got Everton in the draw and now this time. Of course it's nice and it helps but we'd survive without it. What it does mean is that we can bring in one or two more players we need – although I think we've got a good squad at the moment."

The elephant in the room is Oldham's dreadful league form. How a team good enough to beat Nottingham Forest 3-2, score three more against Liverpool, then two against Everton, can lose to Walsall, Brentford and Crewe is a mystery.

Tony Philliskirk, the caretaker who replaced Paul Dickov when he was sacked as manager a fortnight ago, is an interesting character who had a spell as a referee before becoming the club's academy manager. Would he be getting the job on a permanent basis? "We're looking at different applicants but he's unbeaten, the players are responding to him and if you're bringing in someone who doesn't know the players the way Tony knows them, what's the point?" Corney said. "But Tony has got to want it and we've got to want him to want it. I'm not sure, we'll see."

Philliskirk insists he does not want the job, preferring to go back to the academy, so Corney's shortlist just got shorter. The team Dickov assembled did the club proud. They took an early lead when the well-travelled Lee Croft supplied a sumptuous pass from right to left to pick out Jordan Obita, whose long sprint culminated in a sidefooted finish at the far post.

Obita, a 19-year-old left-winger on loan from Reading, fired another shot against Tim Howard's left-hand post, and was a handful for Phil Neville until succumbing to cramp. Everton equalised midway through the half when Victor Anichebe scored with a resounding drive from 12 yards, and when the Premier League team went 2-1 up after 48 minutes the underdogs seemed to have had their teeth drawn. It was a simple, set-piece goal, Phil Jagielka heading in at the near post from a Kevin Mirallas corner.

Steven Pienaar and Nikica Jelavic had chances to put the issue beyond doubt, but instead Oldham rallied and hit back hard, Howard making top-notch saves to deny Smith and Robbie Simpson before that most dramatic of denouements. Philliskirk's charges won successive corners, for which their goalkeeper, Dean Bouzanis, joined the attack and at the second set piece, a left-footed inswinger delivered by Jonathan Grounds, Bouzanis challenged for the ball like a lineout jumper in rugby, provoking chaos in which Smith scored at close range.

There were initialclaims that Bouzanis had handled the ball, but Everton had no complaints. Jagielka, well placed to witness what had happened, said: "Their keeper was jumping with us but I don't think he touched it. It was a great ball in and a great header. Sometimes you have to give credit to the opposition rather than blame yourselves, and Oldham did a magnificent job."