Marte, 31, has spent his entire eight-year career with the Pirates. He has a career .287 batting average with 108 homers, 420 RBIs and 239 steals. He had career highs last season with 23 homers and 82 RBIs.
Marte won Gold Gloves in 2015 and '16.
He reached the All-Star Game in 2016 but also served an 80-game suspension in 2017 after testing positive for steroids.
The Pirates are in the midst of a rebuild after revamping their leadership structure following a last-place finish in the NL Central in 2019. The ascension of outfielder Bryan Reynolds during a breakout rookie season in 2019 and Gregory Polanco's expected recovery from shoulder issues that limited him to 42 games last season gave Pittsburgh the flexibility it needed to move Marte.
The players going to Pittsburgh are right-handed pitcher Brennan Malone, the 33rd pick in the 2019 draft, and shortstop Liover Peguero, a toolsy 19-year-old from the Dominican Republic who excelled in short-season ball.
"We're excited about adding two young players of this caliber and the opportunity we'll have to help them continue to grow," Pirates general manager Ben Cherington said in a prepared statement. "In addition, we now have a greater ability to acquire impact-type talent in this year's international free agent market."
Malone, a hard-throwing right-hander, was considered one of the top prospects in the Arizona system. He went a combined 1-2 with a 4.50 ERA in seven appearances in Class A. Peguero hit a combined .326 (74 for 227) with 11 doubles, 5 triples, 5 home runs and 38 RBIs in 60 games in the low minors last season.
Arizona was dealing from a farm system that is one of the deepest and best in baseball, along with San Diego's and Tampa Bay's.
ESPN's Jeff Passan and The Associated Press contributed to this report.