LAS VEGAS — The Stanford men’s basketball team would like to bottle up about a four-minute stretch of Wednesday’s second half against Arizona State and take it into next season.

The ninth-seeded Cardinal, which did not lead in the game’s final 39 minutes and trailed by as many as 14 points, used a poised comeback to send their Pac-12 tournament opener into overtime before losing 98-88 to the eighth-seeded Sun Devils at T-Mobile Arena.

ASU (15-17) advanced to the quarterfinals to play top-seeded Oregon at noon Thursday, and the Cardinal (14-17) head home knowing that they’re losing only two regular contributors on a team prepared to make a jump in the conference next season.

“As the year went on, we started to mesh more,” said Stanford junior forward Reid Travis, who had a team-high 23 points and nine rebounds. “That definitely takes a backseat in a loss, but we’re definitely encouraged about next year. It’s something that we need to keep doing and keep working on.”

Kodi Justice and Shannon Evans II made three-pointers sandwiched around a three by Dorian Pickens to put Arizona State up 89-84 with three minutes left in overtime. After Christian Sanders’ layup attempt was blocked, Torian Graham extended the Sun Devils’ lead to 92-84 with a corner three-pointer at the 2:31 mark.

After Marcus Allen missed a wing three-point try, Tra Holder made a bucket to boost Arizona State’s lead to 10 and force Stanford to start the foul game. The Sun Devils made all four of their free-throw attempts in the final minute to seal the victory.

The Sun Devils swept the regular-season series against Stanford, winning the two games by a combined 11 points. They are 13th in the nation, averaging only 10.5 turnovers per game, but the Cardinal made it tough.

Stanford forced 13 turnovers and allowed only 10 assists, but Arizona State still managed to shoot 55.9 percent from the floor and 45.5 percent from three-point range.

“They’ve got five shooters out there, with four playmakers and great spacing,” Stanford first-year head coach Jerod Haase said. “It’s very difficult to defend. Our strengths are our size and being tough, but when you’re out there chasing, it’s difficult.”

The Sun Devils had five players in double-figure scoring, led by Obinna Oleka’s 27 points and 13 rebounds. Holder put up 21 points and four assists, Graham had 17 points and seven rebounds, Evans II went for 16 points and six rebounds, and Justice added 15 points.

Stanford, which ended its season on a four-game losing streak, got 18 points and nine rebounds from Michael Humphrey and 26 combined points from Pickens and Allen. Pickens went 4-for-12 from three-point range, his 19th game with at least two threes.

Stanford was in a 74-63 hole with less than 9½ minutes to play. With their chances fading, the Cardinal picked up their defensive intensity. They got stop after stop during a 12-2 run that trimmed Arizona State’s lead to 76-75 on a Marcus Sheffield three-pointer with five minutes on the clock.

Humphrey’s layup trimmed Arizona State’s lead to 81-79 with 1:02 left, and after Holder missed a three-point try from the top of the key, Stanford called a timeout with 25.5 seconds remaining.

Humphrey barely beat the shot clock with a top-of-the-key jumper that tied it 81-81 with four seconds left, and Holder’s wing three-point try missed at the buzzer to send the game into overtime.

Rusty Simmons is a San Francisco Chronicle staff writer. Email: rsimmons@sfchronicle.com Twitter: @Rusty_SFChron