Leaving the Belgian capital with a 1-0 defeat to their name a week ago meant Hacken had it all to do, and their task looked to have got off to the worst possible start as Lucas Boel Hey had the ball in the net for Anderlecht just eight minutes in, but a foul in the build-up provided a reprieve for the Swedish side.
After that wake-up call, Hacken soon got going - a Silas Andersen header just before the 20-minute mark had to be clawed away by Colin Coosemans in the Anderlecht goal, before the hosts broke the deadlock with 33 minutes on the clock.
Amor Layouni sent a testing ball into the box, which was controlled expertly by Adrian Svanback and he rifled the ball low into the bottom corner.
That's how things stayed until early in the second half when Anderlecht were given a huge chance to regain the lead in the tie, as Kasper Dolberg was brought down inside the area by Olle Samuelsson and after VAR consultation, the Belgian giants were awarded a penalty.
Dolberg stepped up, and though Etrit Berisha got a hand to it, the Dane scored to make it 2-1 to the visitors on aggregate.
The Svenska Cupen winners were dominating possession but were heading towards a gallant defeat. That was until stoppage time, when Nathan De Cat caught Mikkel Rygaard inside the area, and this time Hacken were awarded a penalty.
Simon Gustafson held his nerve to beat Coosemans and send the tie to extra time.
Coosemans was at the heart of the best chance of the extra 30 minutes, but this time he came out on top, making a superb save to deny Isak Brusberg.
Yet there would still be time for matters to worsen for the visitors, as a nasty challenge on Marius Lode earned Ibrahim Kanate a second yellow card in the 117th minute. However, the 10 men held on for the final few minutes to take the match to penalties.
Thorgan Hazard was the first to step up in the shootout, dispatching his effort before Gustafson beat Coosemans from 12 yards once more.
But then, it was advantage to the Getingarna, as Sweden's own Ludwig Augustinsson - formerly of Goteborg - blasted his effort against the bar and over, before Amor Layouni scored to put them 2-1 up.
The next penalty for either side was scored, before Berisha guessed right to deny Luis Vazquez. That allowed Berisha himself to step up and the win, which he did by calmly rolling his penalty past Coosemans.
Anderlecht must console themselves with a place in the UEFA Conference League, while a tie with Brann of Norway awaits Hacken in the Third Qualifying Round, as they look to reach the UEL proper for the first time in two years.