Canada have been playing as a two-man team because of injury but Pospisil in particular has been inspired and he defeated John Millman 7-6 (7) 6-4 in the opening singles rubber.
Mystery surrounded the absence of Nick Kyrgios, who had played in the opening two matches but was supporting from the sidelines this time.
Captain Lleyton Hewitt later explained: "He got injured last night. We didn't really have a choice. He couldn't play. So Johnny had to step up to the plate. He had a collarbone injury."
Alex De Minaur kept Australia in contention with a 3-6 6-3 7-5 victory over Shapovalov in the battle of the young guns in front of a disappointingly small but enthusiastic crowd.
But the Australians were unable to complete the comeback, with Pospisil, who is ranked a lowly 150 after injury, and Shapovalov defeating John Peers and Jordan Thompson 6-4 6-4 to set up a clash with either Serbia or Russia on Saturday.
It is the latest success for Canada, who have some of the most exciting young talent in the world of tennis, including Shapovalov and US Open champion Bianca Andreescu.
Play finished a full four hours earlier than on Wednesday night, much to the relief no doubt of organisers, who took a step towards addressing scheduling concerns by adjusting the start time for Friday's quarter-finals.
The group match between the United States and Italy finished at 4.04am in Madrid on Thursday morning, setting an unwanted record for the latest Davis Cup match in history.
It was the second latest finish in all of tennis after the clash between Lleyton Hewitt and Marcos Baghdatis at the Australian Open in 2008.
Friday's contests will begin at 10.30am local time instead of 11am.
But organisers know they will need to find a better solution for next year, when the teething troubles from this inaugural edition of the Cup in this format will not be tolerated.
After guiding Serbia into the quarter-finals, Novak Djokovic said: "I think it was always going to happen, knowing that you have 18 teams and you're trying to squeeze everything in in one week on three courts."
Neither of those issues will be easily addressed. Organisers have committed to holding the competition in Madrid again next year but the Caja Magica does not have the capacity for more courts while there is no appetite for extending the length of the event.
Djokovic suggested only having eight teams in the finals week – something that organisers would resist given the concept of the 'World Cup of Tennis' – while Jamie Murray offered the idea of playing the event across two venues.
Scheduling has emerged as the biggest negative at the new-look event, but on the court organisers will be delighted with the tennis on show and a strong quarter-final line-up.
Serbia eased through on Thursday, following up victory over Japan with a 2-1 success against France that eliminated the top seeds.
Filip Krajinovic produced a fine display to defeat Jo-Wilfried Tsonga 7-5 7-6 (5) before Djokovic claimed a comfortable 6-3 6-3 victory over Benoit Paire, who was preferred to Gael Monfils.
Pierre-Hugues Herbert and Nicolas Mahut won the doubles against Janko Tipsarevic and Viktor Troicki but France's hopes of qualification were already gone.
"This is the most ideal scenario for us," said Djokovic. "Winning both ties after singles and not being really pressured by the doubles.
"So we're coming into the quarters now and playing against Russia tomorrow. That's definitely one of the best quality teams here. It's going to be a big challenge."
Russia were one of the two best-placed runners-up along with Argentina, who will take on hosts Spain.
Spain will be without their number two singles player, Roberto Bautista Agut, who left the competition to return home on Thursday after his father was taken seriously ill. The Spanish federation later announced that Bautista Agut's father had sadly died.
The 31-year-old, who lost his mother suddenly last year, had been due to get married next weekend.
The last quarter-final pits Germany against Great Britain after both teams won deciding doubles rubbers against Chile and Kazakhstan, respectively.