The Hawks needed a boost in confidence.

A night after losing to the Pistons, the Hawks found themselves down by nine points with 5:44 remaining against the Celtics Wednesday. Back-to-back losses, both at home, to teams 20 games under .500 could have proved disastrous to the team’s playoff chances.

What if the Hawks would have lost both those games?

“I wasn’t even going to cross that bridge,” Lou Williams said after the Hawks used a 25-8 run to end a 105-97 victory over the Celtics.

The win reduced the Hawks’ magic number to clinch the eighth and final playoff spot in the Eastern Conference to two games over the Knicks. Each has four games remaining in the regular season. Any combination of Hawks’ wins and Knicks’ losses that equal two will mean a seventh consecutive postseason appearance for the Hawks. They would own the tie-breaker if the teams finished tied by virtue of their conference record.

“We need to get wins,” said Kyle Korver, who made back-to-back 3-pointers in the Hawks’ decisive run. “We need to focus on playing really good basketball. Let’s go make the playoffs. We are going to do this. Let’s go into the playoffs playing good basketball and playing confident basketball. Closing out a game like that hopefully helps build confidence.”

The Hawks and Knicks both face tough challenges Friday. The Hawks play at the Nets, who have a 15-game winning streak at Barclays Center. The Nets won both previous matchups with the Hawks this season, including a 17-point victory in London in January. The Knicks play at the Raptors, who have won the previous two meetings this season by an average of 13.5 points. The Raptors’ magic number to clinch the Atlantic Division is one.

The Hawks have games remaining at home against the Heat on Saturday and Bobcats on Monday and at the Bucks on Wednesday. The Knicks host the Bulls on Sunday, play at the Nets on Tuesday and host the Raptors on Wednesday.

“Make no mistake about it, we are in the playoff race trying to get this eighth spot, and that’s where everybody’s focus should be,” Knicks coach Mike Woodson told reporters Wednesday.

The first-round opponent for the team that secures the final playoff spot also is very much up for grabs. The Heat and Pacers are locked in a battle for the top spot in the conference. The Heat host the Pacers on Friday in a game that will shape that race in the final week.

Hawks coach Mike Budenholzer would not reveal much of his postgame message following the needed win over the Celtics that kept his team in control of its playoff fate. However, several players said the coach applauded the team for its resiliency in putting the loss to the Pistons behind them.

“Great win,” Paul Millsap said of Budenholzer’s speech. “We didn’t get down on ourselves like yesterday. We were the better team, and we proved it.”

Etc.: The Hawks did not practice Thursday before their flight to New York. No update on the condition of Pero Antic's sore right ankle, which caused the starting center to miss Wednesday's game, was available. … SportSouth picked up the Hawks at Bucks regular-season finale Wednesday. The game was originally was scheduled to air on ESPN. The game will start at 8 p.m.