For the second consecutive game, a role player scored his career high and the New Orleans Pelicans came away with the victory.

Backup center Alexis Ajinca scored 24 points, including the winning basket with 25.9 seconds left, as the Pelicans turned back the Miami Heat, 104-102, on Friday at the Smoothie King Center.

“Alexis has been playing well, giving us scoring,” coach Monty Williams said. “The key for him is to stay out of foul trouble and stay on the court.”

The victory was the fourth in a row for New Orleans (31-27) and gave them a 2-0 season sweep of the Heat (25-32) for the first time since the 2008-09 season. More importantly, it enabled the Pelicans to stay in the chase for the Western Confernce’s eighth playoff spot. The Pelicans entered the game in ninth place, 1½ games behind Oklahoma City, which played at Portland late Friday night.

Miami had won its previous two games.

Eric Gordon drove and bounce-passed to Ajinca for the go-ahead layup. Miami then had two chances to tie or take the lead, the second coming after Omer Asik blocked a shot by Hassan Whiteside only to disconnect with Gordon on the outlet pass.

The game ended with Heat star Dwyane Wade missing a 3-point attempt at the buzzer over former Miami teammate Norris Cole.

Gordon had hit a big 3-pointer with 2:21 remaining that tied the score at 98. However, with the score tied at 100, Tyreke Evans was called for charging into Henry Walker, his sixth foul.

With the score tied at 100, Wade lost the ball, then went to the floor to retrieve it and called time out with 38.7 seconds left and two seconds on the shot clock. Walker’s 3-point attempt didn’t beat the shot clock, setting up Ajinca’s winner.

Ajinca scored five quick points inside to start the fourth quarter as the Pelicans began chipping away at a nine-point deficit.

Miami’s Mario Chalmers made a 3-pointer at 9:33 for an 85-79 lead. However, the Pelicans held the Heat to one basket – another 3 by Chalmers at 8:22 – for the next 4 minutes, 10 seconds in storming back to tie the score at 88-88.

The Pelicans led 65-64 midway of the third quarter, but veterans Luol Deng and Wade immediately gave Miami control. Both scored four points, with Wade getting back-to-back drives, and that helped the Heat take a 74-67 lead with 3:03 left.

More important, the Pelicans went 4 minutes, 51 seconds without a field goal, the drought ending on Ajinca’s tip-in at 1:45, cutting the lead to 75-70.

But Goran Dragic asserted himself with his play-making, and when Walker – who signed a 10-day contract on Feb. 21 – sank his third 3-pointer with 39.5 seconds left in the third, Miami led 82-72. The quarter ended with the Heat leading by nine, a bad sign with the Pelicans coming into the game 5-21 when trailing after three.

A sizzling first half ended tied at 54, with the Pelicans shooting 56.1 percent and Miami 54.8, outscoring New Orleans 30-28 in the lane.

The Heat appeared on its way to taking control when it begain exploiting the Pelicans at small forward. With Quincy Pondexter too small to match up, Babbitt guarded Walker. He sank his second 3-pointer of the quarter at 6:56 for a 38-37 lead.

Deng later scored six points in an 8-2 run that gave the Heat a 46-39 lead.

However, Dante Cunningham, who started at power forward, came in at the three, and the Pelicans began playing much bettter defense. That enabled Evans to get on the break, and he had two driving layups and a 3-pointer as the Pelicans roared back to tie the score at 50.

Dragic was a first-quarter nightmare, driving and finishing on the fast break for 12 points on 6-of-8 shooting, a big reason why the Heat scored 18 points in the lane in taking a 25-24 first quarter lead.

NOTE: Pelicans All-Star Anthony Davis received his January NBA Community Assist Award from Hall of Famer Bob Lanier before Friday’s game. … There was a moment of silence before the game to honor Earl Lloyd, the first African-American to play in an NBA game and first black assistant coach. Lloyd, who played nine years in the NBA beginning in 1950, died on Thursday at age 86. … Dragic scored his 500th career field goal at 5:26 of the first quarter on a fast-break layup.