AUBURN HILLS, Mich. -- The Toronto Raptors put the team first against Detroit and the result improved their playoff chances.
Andrea Bargnani had 33 points, Amir Johnson scored a career-high 26 and Toronto beat the Pistons 111-97 on Monday night to snap a five-game losing streak.
The Raptors moved within a half-game of the Bulls for the final postseason spot in the Eastern Conference.
2010 NBA Playoffs
The 2010 NBA playoff picture is taking shape. Check out the up-to-the-minute matchups here: Playoff pairings
Toronto, which closes the season Wednesday at home against New York, will earn a playoff berth if they end the season tied with Chicago, which finishes against the Celtics and at Charlotte.
"We just have to pray on Boston now to beat Chicago," Johnson said.
The Raptors had assists on 21 of their first 22 field goals, finished with a season-high 37 assists, and made 60 percent of their shots overall and on 3-pointers after an awful performance against Chicago on Sunday.
"I know our defense wasn't all that great, but I give them a lot of credit," Detroit coach John Kuester said.
Toronto fell a game behind the Bulls with a 104-88 loss to them Sunday at home, hurting its chances of making the postseason for the third time in eight years.
"We had a lot of guys trying to do too much and going 1-on-1, so we stressed the importance of trusting your teammates and sharing the ball," Raptors coach Jay Triano said.
Charlie Villanueva guaranteed a victory against one of his former teams on his Twitter account Monday afternoon, then scored 16 points in the Pistons' home finale.
"I don't think that fired them up because they had something to play for," Villanueva said. "I thought we would come ready to play, and I'm shocked we didn't after the way we've played lately."
Villanueva created a stir last season when he sent a message on his Twitter account at halftime of a game while playing for Milwaukee.
Detroit -- which has lost two straight after winning three in a row -- fell to 26-55 in its worst performance since losing 62 games during the 1993-94 season.
The Pistons' miserable season ends Wednesday at Milwaukee and they will be relegated to watching the playoffs for the first time since 2001.
Ben Gordon had 24 points, Prince scored 17 and Will Bynum added 12 points and eight assists for the Pistons.
The Raptors were again without star forward Chris Bosh, who had surgery on his broken nose last week, and they lost starting shooting guard Sonny Weems for the last few minutes against Detroit after he appeared to hurt his right ankle.
Weems had X-rays but the team did not have results immediately after the game.
The Pistons got off to a solid start despite having only pride on the line, then got outscored by 14 points in the second quarter and never mounted much of a comeback after halftime.
Bargnani had a lot to do with that.
He scored 12 points in the third quarter and finished a point shy of his career high and matched his best game from the 3-point line, going 5 of 6 from beyond the arc.
"We saw that we had a mismatch with Andrea and we were able to get him the ball in the post for a lot of points," Triano said. "When they changed up the defense, we took him outside and he kept scoring from there. That was huge."
Johnson was selected by the Pistons with the 56th pick in the 2005 NBA draft, making him the last high school player drafted. ... Villanueva was drafted No. 7 overall by Toronto in 2005. ... Pistons owner Karen Davidson, who said in January the option of selling the team was being explored, declined comment on a Detroit Free Press report that Citigroup has been retained to assess the value of the franchise. ... Toronto had a 1½-game lead over Chicago before its recent losing streak. ... Toronto swept a season series from Detroit for the first time.