VANCOUVER -- Vasek Pospisil defeated Go Soeda in straight sets Sunday to lead Canada past Japan 3-2 and into the quarter-finals of the Davis Cup.

The 24-year-old won 7-5, 6-3, 6-4 in one hour 49 minutes in front of a partisan crowd in is hometown.

Canada started the day up 2-1 in the best-of-five World Group first-round tie, but Milos Raonic couldn't close it out against Kei Nishikori, falling in a five-set thriller.

Pospisil, who is ranked 62nd in the world and has spent much of his career in Raonic's shadow, took centre stage and didn't disappoint.

He broke the 86th-ranked Soeda while leading 6-5 in the first set to grab the lead at the Doug Mitchell Thunderbird Sports Centre on the campus of the University of British Columbia. Pospisil then broke the Japanese again leading 4-3 in the second set before clinching the next point when Soeda's shot went long.

Soeda, 30, double faulted to put Pospisil up a break 2-1 in the third set before the Canadian sealed the next point with an ace to go up 3-1.

The pair held serve the rest of the way, with Pospisil closing things out with an ace before dropping to his knees to celebrate.

Earlier in the day, Nishikori, ranked No. 4 in the world, beat the sixth-ranked Raonic 3-6, 6-3, 6-4, 2-6, 6-4 in three hours four minutes to keep his country alive in the tie.

The turning point in that match came with the fifth set tied 4-4 when Raonic double faulted to hand the point to Nishikori.

Nishikori then clinched the match when Raonic, who is ranked sixth in the world, couldn't stretch far enough on a return.

Raonic had been broken earlier in the set by Nishikori to go down 2-1, but responded with a break of his own to knot things up 3-3.

"Momentum, it changes around pretty quickly. I don't think I did anything wrong in (the fifth set) I think he just sort of buckled down later," said Raonic. "He played a few good points and that sort of decides it in that sense. The whole match, it comes down to one or two moments.

"I'm happy with the way I fought, I'm happy with the way I competed, and that's all I can ask of myself."

Raonic fired 28 aces to Nishikori's six, but it was that same serve that cost him at critical moments.

Raonic won the first set against Nishikori, but the Japanese rebounded and won the next two to go up 2-1 after the 24-year-old from Thornhill, Ont., struggled with his first serves.

"I started a little bit shaky. I was missing easy points," said Nishikori. "Second set I started playing well, return well and play a little more aggressive.

With his back against the wall, Raonic broke the 25-year-old Nishikori to take a 3-1 lead in the fourth set before scoring another break up 5-2 to send the match to a fifth and deciding set.

Canada made it to the Davis Cup semifinals for the first time in 2013, but lost to Japan in last year's first round with both Pospisil and Raonic out injured.