The Hornets acquired point guard Jarrett Jack, Australian center David Andersen and guard Marcus Banks from the Raptors in exchange for guard Jerryd Bayless and Serbian Stojakovic as well as cash considerations.
"We are excited about the players acquired today and feel that our short-term and long-term goals will benefit from this move," general manager Dell Demps said in a statement on the Hornets' website (www.hornets.com).
"Peja has been a valued contributor as a Hornet for years and we wish both Peja and Jerryd all the best in their future and thank them for their recent contributions in helping us get off to a strong start."
Stojakovic is in his 13th season in the NBA, averaging double figures in scoring in all but one season with a career best of 24.2 points a game in 2003-04 when he was selected as a second-team All-Star.
In six games this season he has averaged 7.5 points.
(Reporting by Mike Mouat in Windsor, Ontario. Editing by Nick Mulvenney)