NEW ORLEANS — Bothered by a stomach ailment, Anthony Davis’ availability was a game-time decision for the New Orleans Hornets in Wednesday’s game against the Boston Celtics.

Davis was there alright, especially at the end, tipping in a missed drive by Eric Gordon with 0.3 seconds remaining that gave the Hornets an 87-86 victory at New Orleans Arena.

“I saw Eric driving, and I saw my man (Kevin Garnett) go over to help,” Davis said. “That gave me a free lane, and I tipped it in.”

Garnett said he just came over to help Avery Bradley, although Bradley seemed to be forcing a tough shot by Gordon.

“It was just big-man instincts,” Garnett said. “It is what it is.”

Game officials reviewed the play to see if the ball was in the cylinder when Davis touched it, but it was ruled a good play. Garnett tried a 3-pointer after the Celtics got the ball at half court, but the buzzer sounded before the ball left his hands.

The victory was New Orleans’ second of the season against Boston and gave it a sweep of the series. It also ended a four-game losing streak for the Hornets (23-46), who had lost seven of their past eight games.

Although they committed 20 turnovers, the Hornets won by bludgeoning the Celtics on the boards for the second time, 45-28, getting 11 on the offensive end.

The Celtics (36-31), in the middle of the Eastern Conference playoff race, lost their second consecutive heart-breaker, having fallen to Miami by two on Monday night that pushed the Heat’s winning streak to 23 games.

It appeared that the Hornets were the ones on their way to another heartbreaking loss.

Boston led 86-81 with 1:54 left in the game. However, Gordon sank a short jumper 22 seconds later. After a Boston possession netted two misses, Ryan Anderson, who led the Hornets with 21 points, was fouled by Paul Pierce while attempting a 3-point shot with 35.5 seconds left.

Anderson missed the first free throw. He made the next two, but it left the Hornets trailing 86-85.

The Celtics then got a matchup they would like, as a screen resulted in Pierce being guarded by Gordon, four inches shorter. Pierce tried to back Gordon into the lane, but he didn’t budge. As Pierce shot, Gordon tipped the ball. The shot missed, Davis secured the rebound, and the Hornets called timeout with 15.6 seconds left.

Gordon let the clock run down to about six seconds before making his move against tough defense by Bradley.

Celtics coach Doc Rivers appeared livid at the way his team lost. Boston scored just 31 points in the second half, including 12 in the third quarter.

“I believe we deserved this,” Rivers said. “We stopped passing, we stopped defending. We were messing around.”

Hornets backup point guard Brian Roberts, who helped key the comeback, said the Hornets focused on defense after a halftime tongue-lashing by Hornets coach Monty Williams.

“Their ball movement was really effective in the first half, mostly because they were driving and finding guys and we were over-rotating,” Roberts said.

“We talked more on defense in the second half and did a better job of keeping them in front of us on drives.”

After shooting 68.4 percent in the first quarter and 60 percent in the first half, Boston, which led 55-45 at halftime, was held to 27.8 percent in the third on 5-of-18 shooting. And, the Hornets began asserting themselves in the same manner that proved effective in their 90-78 win in Boston on Jan. 16 — they pounded the boards, outrebounding the Celtics 17-4 in the quarter in outscoring them 22-12, with Gordon leading the way with seven.

The Hornets had cut a 13-point deficit to 60-56 midway of the third, before former LSU Tiger Brandon Bass made a three-point play. Undaunted, the Hornets continued to claw back, even after committing their 17th turnover shortly after, as the Celtics suddenly started going one-on-one and subsequently went cold.

Having tied the score at 67 by the end of the third, New Orleans jumped on Boston at the beginning of the fourth. Roberts sank a jumper 10 seconds into the quarter, and Anderson hit a jumper on the next possession. With a 22-foot pass, Roberts then found Anderson cutting to the basket, resulting in two free throws.

When Anderson sank a 3-pointer at 6:13, the Hornets had gone on a 11-2 run and led 78-69, before Boston came back as Pierce and Bradley re-entered the game.