Everton substitute Bernard's extra-time strike sealed a 5-4 victory over Tottenham Hotspur in an absorbing FA Cup fifth-round thriller at Goodison Park on Wednesday. The 28-year-old Brazilian has been on the fringes of the Everton squad this season, but settled a see-saw tie with a powerful left-footed strike in the 97th minute. It meant Tottenham's wait for a first FA Cup triumph since 1991 goes on, but kept alive Everton's hopes of winning the trophy for the first time since 1995. Tottenham, who battled back from 3-1 and 4-3 down having taken the lead in the third minute, have now lost four of their last five games and while they played some admirable attacking football, they were undone by defensive frailties. "I enjoyed it, and I didn't enjoy it!" Tottenham manager Jose Mourinho, who was up against respected rival Carlo Ancelotti, said of a breathless tie. "We scored goals, created more chances, great character to fight against incredible mistakes. But attacking football only wins matches when you don't make more defensive mistakes than what you create. We scored four goals, but was not enough." Everton were not at the races in the opening minutes and they fell behind in the third minute when Tottenham defender Davinson Sanchez headed past Robin Olsen. Tottenham could have been further ahead but their night fell apart in seven first-half minutes. Dominic Calvert-Lewin had already hit the woodwork but he levelled in the 36th minute when the excellent Gylfi Sigurdsson teed him up and his shot, though directed at Tottenham keeper Hugo Lloris, was too powerful for the Frenchman. Two minutes later Calvert-Lewin's flick opened up space for Richarlison who beat Lloris with an angled low drive. Sigurdsson then appeared to have dealt a hammer blow to his old club when he tucked home a penalty after Pierre-Emile Hojbjerg had tripped Calvert-Lewin. Erik Lamela's close-range finish in first-half stoppage time swung the momentum back to Tottenham though. Defender Sanchez, who had scored only once in 137 appearances for Spurs, poked home his second of the night in the 53rd minute to haul Tottenham level. Richarlison put Everton ahead again 10 minutes later when another great ball by Sigurdsson sent him clear and he beat Lloris from a tight angle with a shot in off the right-hand post. Harry Kane had been left on the bench by Mourinho until the 53rd minute and he had then been relatively quiet but inevitably he got Tottenham back into the tie when he headed in a superb cross from Son Heung-min in the 83rd minute. The frenetic pace dropped a little in extra time but there were still chances for both sides. But it was Bernard who decided it when Sigurdsson's deft pass cut out the Spurs defence and the Brazilian struck the ball across Lloris and into the net. "It was end to end, great for the fans watching at home," Everton assistant manager Duncan Ferguson, part of the 1995 Cup-winning side, said. "Great for us to go through - we showed a lot of good spirit, then Bernard pops up with the winner." The only cloud for Everton was a hamstring injury to Calvert-Lewin that forced him off after 55 minutes.