Basel's dominant performance at home a week ago had left Valencia with a mountain to climb back at the Mestalla, but Alcacer set them on the way with a 38th minute opener before Eduardo Vargas added another two minutes before half-time.
Alcacer's second of the game with 20 minutes to go ensured extra-time before Basel had both Marcelo Diaz and Gaston Sauro sent off for second bookable offences in the first period.
Valencia finally took advantage on 113 minutes when Alcacer completed his hat-trick before Juan Bernat's goal two minutes from the end wrapped up one of the most memorable comebacks in European footballing history.
It is the first time any team has recovered from a 3-0 first-leg deficit since the first Europa League season in 2009-10.
Valencia had plenty of the ball in the early stages but did not really threaten until they opened the scoring in the 38th minute.
Joao Pereira's clever ball to the back post was taken down on his chest by Alcacer, who fired confidently past Yann Sommer with his second touch.
The keeper somehow prevented Vargas from scoring in the 42nd minute with a diving header from point-blank range after Alcacer had worked the ball into his path.
But from the corner the Basel keeper was helpless as Fede Cartabia's delivery picked out Vargas, who planted a firm header under the bar.
The start of the second half, not surprisingly, was dominated by Valencia and they came agonisingly close to parity in the 54th minute when Cartabia's free-kick picked out Vargas.
The striker seemed to handle the ball but he was allowed to play on and drew another terrific save out of Sommer.
The ball rebounded to him but he was virtually on the goal-line and could only divert it against the outside of the post.
Valencia hit the woodwork again in the 66th minute as Alcacer unleashed a shot from 20 yards that was brilliantly tipped onto the bar by Sommer.
But four minutes later Alcacer was not to be denied, lashing in the third after Vargas had done well to flick Pereira's long ball back into his path.
Alcacer had the chance to win it three minutes from the end of normal time after horrible defending from Basel but a poor first touch allowed Sommer to block.
Basel's job became even harder 12 minutes into the first period of extra time when Diaz rashly kicked Jonas and was shown a red card.
And three minutes later they were down to nine men as Sauro collected two yellow cards in the space of 60 seconds.
Remarkably, Basel might have won it through Serey Die's deflected shot, but it dropped agonisingly the wrong side of the post.
And in the 113th minute Valencia finally got their fourth goal, Alcacer tucking Pablo Piatti's cross into the net, before Bernat finished off the scoring in style.