Nate Schierholz also homered for Washington. The NL East-leading Nationals hit 10 home runs in the series, one short of the Safeco Field record for a three-game set established by Cleveland in 2009.
Seattle stopped its three-game losing streak. The Nationals have dropped four of six.
The Mariners trailed 3-1 in the fifth when Ackley hit a three-run homer off Tanner Roark (12-9). It was his 11th homer this season.
Ackley also singled home a run, and tied his career high for RBIs in a game. He is hitting .319 with 19 extra-base hits since the All-Star break.
Hisashi Iwakuma (13-6) went six innings, allowing three runs and five hits. He struck out six and walked none. Over his last 11 starts, he is 8-2 with a 2.35 ERA and has 72 strikeouts and five walks.
Relievers Charlie Furbush, Danny Farquhar and Yoervis Medina combined to work two hitless innings. Fernando Rodney gave up a leadoff single to Harper in the ninth before getting his 39th save in 42 chances.
Brad Miller and Austin Jackson each had three hits for the Mariners.
Roark lasted 6 1-3 innings, giving up four runs and 11 hits.
Harper hit a 418-foot, solo homer in the second, the first run Iwakuma had allowed against National League teams in 23 innings.
Harper hit a 416-foot shot to straightaway center in the fourth for his 10th homer this season. It was his fifth career multiple home run game.
The Mariners added a run in the eighth on Endy Chavez's RBI double.
Mariners manager Lloyd McClendon, who missed the previous two games to attend his daughter's wedding in Indiana, returned just before game time and assumed his duties. Bench coach Trent Jewett had been serving as interim skipper.
Nationals: Washington, which has the best record in the NL, open a three-game series Monday night at Dodger Stadium, where Los Angeles has the second-best record in the league. Nationals LHP Gio Gonzalez (6-9) faces RH Roberto Hernandez (8-9).
Mariners: Seattle opens a three-game series at Oakland beginning Monday. Chris Young (12-6) will be opposed by South Kitsap High School product Jason Hammel (1-5). It's the first of 18 road games for the Mariners in September against only nine home games.