Shai Gilgeous-Alexander had a game-high 32 points, including the go-ahead basket with 28 seconds left to give the Oklahoma City Thunder the lead for good, as OKC beat New Orleans 123-118 in the Western Conference Play-In Tournament on Wednesday night in New Orleans.

The Thunder will play Minnesota on Friday night for a spot in the NBA Playoffs.

The game had 13 ties and 13 lead changes, with neither team leading by more than 10 points.

It ended OKC’s 12-game losing streak in road games in the postseason, with their last win coming at Golden State in Game 1 of the 2016 Western Conference Finals.

SGA’s jumper gave OKC a 115-114 lead, then the Thunder went 8-for-8 at the free throw line from there to ice the game.

The Thunder were 28-for-32 at the free throw line as a team.

Josh Giddey nearly had a triple-double, with 31 points, 9 rebounds and 10 assists.

Luguentz Dort had 27 points and made four 3-pointers.

The Thunder trailed by nine in the first quarter, then after taking the lead, were down six at halftime.

OKC outscored the Pelicans 39-24 in the third quarter and led by 10 late in the period.

The Pelicans went on 14-4 run to start the fourth quarter to take the lead, then the lead changed hands five times after that.

Brandon Ingram led the Pelicans with 30 points.

Former Edmond Santa Fe standout Josh Richardson had 9 points for the Pelicans, who outshot OKC 48 percent to 46 percent from the field, and outrebounded the Thunder 48-38.

The Thunder will play at Minnesota Friday at 8:30 pm, with the loser eliminated and the winner advancing to the playoffs to play top seed Denver in a best-of-seven first round series.