In a season where so many things have inexplicably gone wrong time and again, the Orlando Magic finally got it all right Friday night.

They defended, holding the misfiring Detroit Pistons to an abysmal 35.8 percent shooting. They rebounded, standing up to big Ben Wallace while winning the battle on the boards, 49-42. And, at last, Tracy McGrady got some much-needed offensive help and didn't have to figuratively carry the Magic on his ailing back.

It all added up to a much-needed 87-78 victory for the Magic, snapping a three-game skid and sending them on next week's three-game road trip with a renewed confidence.

"This is always the best kind of win because everybody gets some confidence out of one like this and it builds trust throughout the team," said Magic point guard Darrell Armstrong, who hit two key 3-pointers in the fourth quarter and scored a game-high 21 points. "Yeah, we've been struggling, but it's a very long season. A lot of people might think the season is already over for us, but it's not. We're going to keep fighting."

Granted, Orlando's victory came against a Detroit team that has lost seven in a row. But after getting outrebounded in seven of their past eight games and exposed defensively numerous times of late, the Magic (14-17) were downright giddy late Friday night about any win.

"Our guys had to fight it out and they hung in there," said Magic coach Doc Rivers, who held a two-hour meeting with the team the day before. "Detroit made a run (in the third quarter), but it didn't bother them because they were playing with confidence."

Coming off one of his worst games as a professional in Wednesday's loss to Indiana, Mike Miller rebounded to score 14 points and play some smothering defense on Detroit star Jerry Stackhouse. In 42 minutes, Miller held Stackhouse to three of 15 shooting and 13 points.

"I started slow, but my defense was a way to get back into the game," Miller said. "I had to pick it up defensively and get into (Stackhouse). I couldn't let him chose which direction he went. I had to direct him."

Stackhouse seemed more eager to blame himself than credit Miller's defense.

"I feel I'm not the guy who is stepping up to deliver for this team," he said after falling nine points shy of his season scoring average. "I felt like 11 of the 12 guys played well enough to win the game. I did not play well and I have to find a way to do better for us. I'm disappointed right now."

Former Magic center Ben Wallace led Detroit with 16 points, 13 rebounds and four blocked shots. Wallace, who starred in Orlando during the 1999-2000 season and was included in the sign-and-trade deal for Grant Hill, leads the NBA in blocked shots and ranks seventh in rebounding.

McGrady was in foul trouble most of the night, but still had 20 points, eight rebounds and six assists before fouling out with 50 seconds to play.

Patrick Ewing and Horace Grant gave the Magic a surprising boost in the middle with Ewing playing well in the first half and Grant finishing strong. Ewing, who will return to New York Sunday, had 11 points and nine rebounds. Grant had nine points and eight rebounds and two big baskets in the fourth quarter off perfectly executed pick-and-rolls with McGrady.

"It's what we need from them, but it's going to be tough for them to do that every night. They're not exactly spring chickens," Rivers said. "As good as Patrick was in the first half, Horace was just as good in the second half. If we can get that type of play out of one of them a night, I'll be happy."

The Magic failed to pull away when it had an early 18-point lead, allowing the Pistons to get within five heading into the fourth quarter. Part of the reason was because McGrady and Armstrong went cold. McGrady, the NBA's fourth-leading scorer, had just five points in the first half and 12 through three quarters. Armstrong, who had to keep his aching back wrapped while on the bench, scored 10 points in the first quarter, but did not have a field goal in the second and third periods.

But the two played well in the fourth quarter, turning back the Pistons when they pulled within five points three different times in the final period.

Orlando held the Pistons to a season-low 30 points in the first half, but it was difficult to tell whether it was because of good defense or just some downright sorry shooting. Detroit, mired in a major offensive funk during its six-game losing streak, hit just 12 of 42 shots and trailed 42-30 at the break.

Detroit actually had to finish strong to get to 28.6 percent in the first half. The Pistons missed 25 of their first 33 shots and fell behind by as many as 18 points early on. Detroit went more than six minutes without a field goal in the first quarter, allowing the Magic to put together a 14-1 run.

"It was a real nice defensive game for us," Armstrong said. We really got after it all game long. "They got a little run on us, but guys stayed in there and kept fighting."