Marion is set to receive a five-year contract from the Mavericks worth an estimated $39 million, according to sources.
Under the sign-and-trade deal, the Orlando Magic traded Hedo Turkoglu to the Toronto Raptors. The Raptors sent Marion, Kris Humphries, Nathan Jawai and cash considerations to Dallas, while also sending a future second round draft pick to the Memphis Grizzlies.
The inclusion of Jawai to the Mavericks was a new wrinkle in the deal. In an earlier version, the Raptors were to send Quincy Douby to the Grizzlies instead.
According to sources, the cash that accompanies Stackhouse from Dallas will help the Grizzlies buy out his contract. Only $2 million of Stackhouse's $7.25 million salary next season is guaranteed, as long as he is waived by Aug. 10.
Marion earned $17.8 million last season and was traded for the second straight February when Miami sent him to Toronto in a swap for Jermaine O'Neal. He went from Phoenix to Miami one year earlier in the Shaquille O'Neal trade.
A deal with Dallas appeared to be Marion's best and last hope for securing a new contract starting above the $5.9 million midlevel exception.
Turkoglu, a 6-foot-10 forward, was one of the most coveted free agents available, coming off a season in which he helped the Magic reach the NBA Finals.
The nine-year NBA veteran appeared poised to sign with the Portland Trail Blazers last Friday before Raptors general manager Bryan Colangelo swooped in and nabbed the Turkish forward.
Turkoglu's agent, Lon Babby, said the player and his wife, Banu, were intrigued by Toronto's ethnic diversity, including a large Turkish community.
He also got an assist from Chris Bosh, the Raptors' All-Star forward.
"Little known fact, Chris helped recruit Hedo last Friday," Colangelo said at a news conference. "[I] reached out to Chris, Chris made a phone call and I would believe that would be a very important call for this guy to get when Chris Bosh calls you and says, `I want you to come play for us and make us better."
Turkoglu opted out of his contract in Orlando when the team acquired Vince Carter from New Jersey. Turkoglu was due $7.3 million next season, the final year of a $36 million, six-year deal with the Magic.
He averaged 16.8 points and 5.3 rebounds last season, and has averaged 12.3 points and 4.2 rebounds over his career, which included stints with Sacramento and San Antonio before he signed with Orlando as a free agent in 2004. He is a a 38.5 percent shooter from 3-point range.
Marc Stein is a senior NBA writer for ESPN.com. Information from The Associated Press was used in this report.