Stojakovic was one of four Indiana players to have at least 20 points before the start of the fourth quarter.
Anthony Johnson added 22, Stephen Jackson had 21 and Jermaine O'Neal 20 for the Pacers, who are trying to improve their seeding in the Eastern Conference playoffs.
Indiana has clinched its ninth straight playoff appearance.
"This was very important. We've been playing well at home, but for whatever reason we can't transfer that success on the road," Johnson said.
The Pacers are tied with Milwaukee and Chicago for the sixth seed in the East. They are a half-game behind Washington.
With Indiana up by 32 points in the fourth, official Dick Bavetta acted like he was a player by catching a ball out of bounds and throwing a pass to a surprised Sarunas Jasikevicius, who inbounded the ball to Stojakovic.
Indiana never trailed after Toronto scored the first basket of the game, and they led by as many as 37.
"We were raining J's," Johnson said.
Morris Peterson scored 27 points for the Raptors, who have lost 11 of 12 since All-Star forward Chris Bosh suffered a season-ending thumb injury.
Fans booed the Raptors as the final buzzer sounded. Toronto ends the season in Chicago on Wednesday.
"We got to keep playing and not get down ourselves. It was a mental game today," Toronto's Charlie Villanueva said. "It was really hard. It's frustrating."
Indiana shot 57 percent, while Toronto shot 38 percent.
The Pacers made 14 of their first 16 shots and scored 40 points in the first quarter on 83 percent shooting from the field.
Indiana followed that with 11 assists on 11 field goals in the second quarter.
And they finished the first half on a 18-4 run that included two 3-pointers from Stojakovic. The Pacers led 70-51 at halftime.
Stojakovic scored eight straight points on two 3-pointers and two free throws to give Indiana a 30-point lead with 5:34 left in the third. O'Neal blocked two of Rafael Araujo's shots and scored four straight points to give Indiana a 35-point lead just before the end of the quarter.
"This game was very important for us with the playoff seeding," Stojakovic said. "The last game is going to be important, too."
Loren Woods, Toronto's little used center, had a career-high 14 rebounds and 12 points.
Araujo -- the starting center -- was scoreless on 0-for-7 shooting from the field.
Toronto point guard Mike James barely looked to pass, finishing with one assist and going 5-for-14 from the field for 14 points.
The Raptors finished 15-26 at home.
Toronto coach Sam Mitchell said the Raptors should be better next season because they lost so many close games this season. Toronto lost 11 games by three or fewer points and lost nine of 10 in overtime. ... Canadian Olympic gold medalist Cindy Klassen sat courtside. The speed skater has six Olympic medals. Bavetta led to her to the center of the court so she could receive a standing ovation.