Pittsburgh is also getting $250,000 in international slot money, according to Jon Heyman of MLB Network.
Marte, a former All-Star, accrued an .845 OPS with 23 home runs and 82 RBIs in 132 games last season.
"We think he's a fantastic baseball player," D-Backs general manager Mike Hazen said, according to Steve Gilbert of MLB.com. "He has power, he can hit for average, he is a very good athlete, plays a very good outfield, center field as well."
The 31-year-old will make $11.5 million on a club option for 2020. His contract also has a $12.5-million team option with a $1-million buyout for 2021. The Pirates will pay $1.5 million of Marte's salary for next season.
Arizona is enjoying a successful offseason. The club also added four-time All-Star Madison Bumgarner, reliever Hector Rondon, and outfielder Kole Calhoun to a team that surprised many last season with an 85-win campaign.
Pittsburgh, meanwhile, gets two 19-year-old prospects in the deal. Malone, the 33rd overall pick in last year's draft, was the No. 9-ranked minor leaguer in Arizona's system at the end of 2019, while Peguero slotted in at No. 18, according to MLB Pipeline.
"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 statement. "In addition, we now have a greater ability to acquire impact-type talent in this year's international free-agent market."
Peguero slashed .364/.410/.559 with 15 extra-base hits over 38 games with Rookie Advanced Missoula of the Pioneer League last season before struggling after a promotion to Single-A Hillsboro. Malone, a 6-foot-4 hurler, posted a 4.50 ERA in eight innings between rookie ball and Hillsboro.