ORLANDO — After the Hawks defeated the Magic in the Eastern Conference playoffs last spring, much of the analysis centered on all the shots Orlando missed.

Before the teams met Friday for the first time since that series, Magic coach Stan Van Gundy lauded how the Hawks played defense then.

“Their defense was good against us, and it affected us,” Van Gundy said. “We missed some shots that were presented to us, but their defense was outstanding. That certainly was the biggest factor in our struggles.”

It was the same scenario for the rematch. The Hawks used gritty defense to build a nine-point lead, squandered it, and then survived to win 89-87 in overtime.

The Hawks (18-9) won their fourth consecutive road game and improved to 5-7 against opponents with winning records.

“After they came back to tie it, it could have been a time for us to walk away with our tails between our legs,” Hawks coach Larry Drew said. “What we did instead was respond.”

The Hawks blew a 78-70 lead when they failed to score over the final 2:26. Orlando tied the score with 1.3 seconds to play when Dwight Howard followed Jameer Nelson’s miss with a dunk.

Orlando took leads of 81-78 and 83-81 in overtime when the Hawks took control with three consecutive baskets. Jeff Teague pulled up for a jumper, Joe Johnson scored on a runner and then Johnson made a challenged, turnaround jump shot for an 87-83 lead.

Orlando rallied one last time in the final minute.

Orlando’s Ryan Anderson made a 3-pointer to cut the lead to 87-86, and Jason Richardson’s free throw pulled Orlando within 88-87 with 11.6 seconds left. After Hawks center Zaza Pachulia made a free throw for an 89-87 lead with 10 seconds to go, Richardson and Nelson each missed 3-point tries, and the Hawks escaped.

“That’s been in our DNA all season long,” Josh Smith said after leading the Hawks with team highs of 23 points and 19 rebounds and added five assists. “We’ve been playing with a certain toughness and grittiness.”

The Hawks seem to have figured out the Magic. Hawks center Jason Collins was key to the Hawks’ strategy against Orlando in the postseason last year, when he annoyed Howard in single coverage and freed the rest of the Hawks to stay home on Orlando’s shooters.

Collins was out with an elbow injury Friday, but the Hawks managed to execute a similar plan with Pachulia. Howard overpowered Pachulia for a couple of stretches, but Pachulia also enticed Howard into a couple of charging calls and did his best to deny Howard deep post position.

Howard finished with 18 points and 18 rebounds. Pachulia held his own with nine points and 10 rebounds, and Hawks reserves outscored their Magic counterparts 17-9.

The Hawks needed a strong defensive effort because they didn’t play particularly well on offense after a sharp start.

The Hawks’ offense flowed during the opening minutes with crisp passing for open looks. The Hawks worked the ball inside-out while building a 16-7 lead.

But Orlando rallied by turning long rebounds and turnovers into scores. The Magic used a 10-0 run for a 17-16 lead, and the teams exchanged the lead eight more times in the first half.