Marte opened the game with a triple and hit solo shots in the second and eighth for the first multihomer game of his career. Locke (7-1) limited Seattle to two runs and four hits, leaving him tied for second in the National League with a 2.06 ERA.
Brandon Inge had a three-run shot in the second inning, his first home run since Aug. 1 with Oakland against Tampa Bay. Russell Martin and Gaby Sanchez also went deep for the Pirates in their first five-homer game since July 22, 2009, against Milwaukee.
It was the second time this season the Mariners have allowed five long balls. Houston connected five times on April 9.
Kyle Seager hit his 10th home run in the sixth for the Mariners. It was the sixth that Locke has allowed this season, first by a left-handed hitter.
Justin Smoak added a two-out, two-run homer in the ninth off Bryan Morris.
Marte rattled his first-inning triple into the right-field corner and scored on Jordy Mercer's groundout.
That was as much damage as Mariners lefty Joe Saunders (5-8) allowed in his previous start Wednesday at the Los Angeles Angels, when he gave up his only run on a wild pitch in a complete-game, 1-0 loss.
Saunders couldn't complete two innings this time as the Pirates chased him with five runs in the second.
Martin opened the inning with his home run to center, his eighth. With one out, Tony Sanchez singled and Neil Walker walked. Inge, with two hits in his previous 32 at-bats, connected for a three-run shot to left on a 2-2 pitch.
One pitch later Marte homered to right-center.
After Andrew McCutchen's two-out double, Blake Beavan replaced Saunders, who is 10-3 in 17 starts at Safeco Field. His ERA at the park rose from 2.31 to 2.80.
The Mariners scored a run in the second on Carlos Triunfel's two-out single to center, driving in Raul Ibanez from second.
Seager opened the sixth with his home run to right on a 2-1 pitch from Locke.
Marte hit his eighth homer with two outs in the eighth on the first pitch from Carter Capps. Sanchez hit his seventh in the ninth off Capps.
NOTES: The last time Saunders worked just 1 2-3 innings was Aug. 7, 2009, with the Angels against the Rangers. His career low is two-thirds of an inning on Sept. 30, 2006, with the Angels against the A's. ... The Pirates have had eight scheduled days off this season, including one Monday. They are 8-0 in the first game after an off day. ... Before the game, the Mariners placed CF Franklin Gutierrez on the 15-day disabled list (strained right hamstring) and recalled OF-2B Dustin Ackley from Triple-A Tacoma.