Trailing 2-0 from the opening day, a Denmark team led by world No. 11 Holger Rune appeared to be set to clinch victory despite losing the opening doubles on the second day of the tie.
World No. 67 Pedro Martinez was match point down against Rune in the third set of a dramatic match, but found a way to battle back and take a 6-1, 4-6, 7-6(3) win.
Rune was warned by the umpire for firing two balls out of the arena after being broken in the opening set and he was very much the villain of the piece for the Spanish fans who were vocal in their support of Martinez.
"The feeling [at Davis Cup] is totally different," said Martinez after his epic win.
"Maybe I get more nervous but, this adrenaline doesn't work on some players. On me, it gives me an extra motivation to play full out. I feel the nerves, but I can handle them, and I think this motivation plays in my favour.
"Hopefully I can continue playing like this in Davis Cup. For me, it's one of the most important things in my career."
Martinez's thrilling win paves the way for a Spanish win, with the experience Pablo Carreno Busta winning the final match of the tie against Denmark's Elmer Moeller at the Club de Tenis Puente Romano to spark wild celebrations among the home fans as their team sealed the eighth and final place in the Davis Cup finals.
This was the first time Spain overturned a 0-2 overnight deficit for the first time ever in the Davis Cup, with captain David Ferrer now hoping he will be able to call upon world No. 1 Alcaraz for the finals in Italy.
The event will take place a week after the ATP Finals in Turin, so Alcaraz will not have far to travel if he opts to take part in the competition, after he pulled out of the Denmark tie due to fatigue after his US Open win earlier this month.
Sinner is expected to lead the Italian team once again after he played a pivotal role in guiding Italy to Davis Cup glory over the last two years.
If we do get an Alcaraz vs Sinner battle in front of a partisan Italian Davis Cup crowd, it would be a fitting end to a year dominated by the two players who have shared the Grand Slam titles between them for the last two years.
Alcaraz has won and lost two of the singles matches he has played in the Davis Cup and he could take on Sinner, who has won 15 and lost four times in singles when playing for his country.
The Davis Cup Final 8 line-up is now complete with Austria, Argentina, Belgium, Hungary, Italy, Germany and Czechia joining Spain in Bologna for an event that gets underway on November 18.