As tipoff approached Wednesday night, Orlando Magic coach Stan Van Gundy said he had no doubt his players would begin their game against the Washington Wizards with plenty of energy.

Something concerned him, though. He worried what would happen if the Wizards went on a run. Would the Magic’s fragile confidence shatter? Would everything snowball out of control, just as it had several times within the last week? Would the Magic lose a fifth consecutive game for the first time in Van Gundy’s tenure?

The Magic wound up passing the test. But not without a struggle.

Fueled by their 3-point shooting, Orlando overcame a turnover-filled first half to beat Washington 109-103 at Amway Center.

“We’ve still got to get a lot better,” Van Gundy said afterward. “But I think what sort of breaking the ice does in getting a win is now it allows you to get your mind on getting better instead of your mind on, ‘God, we haven’t won a game in forever.’ ”

The Magic gladly will take a win at this point. Any win.

But in the victory, the team received reminder after reminder of what it needs to do to get back to where it once was. It still had trouble to protect the basketball. It continued to have difficulty just bringing the ball up the court. And few people other than Dwight Howard grabbed a defensive rebound.

Ryan Anderson scored a team-high 23 points, including a trey that put the Magic ahead 104-97 with 42.2 seconds left.

Howard and J.J. Redick scored 21 points apiece, and Howard collected 18 boards.

“We didn’t want to focus too much on that streak, because that’s a week we’d all like to forget and those games we’d like to just forget about,” Anderson said. “We can move forward and get a win next game and then just start a little run. I think this started our confidence, but we need to follow through with it.”

The Magic needed everyone’s contributions, especially with their starting backcourt of Jameer Nelson and Jason Richardson out with injuries.

Although Orlando raced out to a 25-14 lead with 1:22 to go in the first quarter, Washington responded.

The Wizards went on a 22-5 run that ended with Kevin Seraphin following Trevor Booker’s missed layup with an emphatic dunk.

The run evoked memories of last Thursday’s loss to the Boston Celtics, in which the Magic gave up a 27-point lead in the second quarter and lost at home.

Once again, the Magic had problems dealing with an opponent’s fullcourt pressure, committing 11 of their 15 turnovers in the first half.

This time, though, the Magic didn’t wilt.

Orlando made 13 of its 30 shots from beyond the arc and also attempted 39 free throws to Washington’s nine.

“It’ll give us a little bit more confidence,” Howard said. “We needed this one. It was tough. It was ugly at times out there, but a win is a win, you know? It’s good to have.”

It also helped the Magic that they contained Washington’s super-fast second-year point guard, John Wall. Wall went 1-for-12 from the field and didn’t make his basket until a driving layup with 3:08 left in regulation. He did have 10 assists and only three turnovers.