PITTSBURGH -- Ten years ago and with the franchise in dire financial straits at the time, the Pittsburgh Pirates traded a young slugging third baseman named Aramis Ramirez to the Chicago Cubs in a salary dump.
Ten years later, the trade continues to haunt the Pirates.
Ramirez is now with Milwaukee, but he lifted the Brewers to a 7-6 victory over the Pirates on Tuesday night at PNC Park with three hits, four RBIs and the 350th home run of his 16-year career.
The Pirates entered the day 1/2 game behind the St. Louis Cardinals in the National League Central race but lost their third game in a row.
Caleb Gindl gave the Brewers the win with a pinch-sacrifice fly in the eighth inning that broke a 6-6 tie.
Milwaukee's Norichka Aoki reached base in all five plate appearances with two singles and three walks. Jonathan Lucroy added three hits and Scooter Gennett had two.
Pedro Alvarez went 4-for-4 with a walk and his NL-leading 32nd home run for the Pirates. Neil Walker had a three-run homer among his two hits. Andrew McCutchen, Andrew Lambo and Felix Pie also had two hits.
With the Pirates down a run, McCutchen doubled and Alvarez walked with one out in the ninth, but Jim Henderson held on for his 22nd save in 25 opportunities.
Rob Wooten (3-0) allowed Alvarez's homer but pitched 1 1/3 innings for the win.
With the game knotted at 6-all, Rafael Betancourt hit a one-out double for Milwaukee off Bryan Morris (5-7) in the eighth and took third on Gennett's single. Gindl then lifted a fly to right that scored Betancourt and gave the Brewers their third victory in four games.
Both starting pitchers had bad nights.
The Brewers' Kyle Lohse gave up five runs and 13 hits in 5 1/3 innings with two walks and three strikeouts. The Pirates' Jeff Locke was tagged for five runs and eight hits in 4 2/3 innings while walking four and striking out two.
Lohse had gone 4-1 with a 2.05 ERA in seven starts since the All-Star break.
Meanwhile, Locke's struggles continued as he has allowed 16 runs and 23 hits in 11 1/3 innings in his last three starts. In his last seven outings, he is 0-2 with a 7.02 ERA.
Alvarez tied the score 6-6 by lining a solo home run off the right-field foul pole, snapping a tie with Arizona's Paul Goldschmidt for the league lead.
Milwaukee had gone ahead by a run in top of the inning when Ramirez lined a two-out RBI double to center that scored Lucroy, who had singled.
Felix Pie had made it 5-5 in the sixth with a run-scoring single.
Milwaukee loaded the bases with none out in the first inning but managed just one run, which came home on Ramirez's double-play grounder.
Ramirez hit a solo home run to left with one out in the fourth, his eighth homer of the season, to make it 2-0.
An inning later, Ramirez capped a three-run fifth by lining a two-run double off the glove of retreating left fielder Jose Tabata with two outs. That came right after Lucroy's RBI single.
Pittsburgh then scored four times in the fourth to cut the deficit to 5-4. Pie's double glanced off Aoki's glove on the warning track and Walker belted a three-run homer, his ninth home run of the season, that carried over the right-field stands.
The Pirates made a trade before the game, acquiring right fielder Marlon Byrd and catcher John Buck from the New York Mets in an effort to bolster an offense that entered the day 10th in the National League and 24th in the majors in scoring with an average of 3.89 runs a game.
The Pirates sent low Class-A West Virginia second baseman Dilson Herrera, a player to be named to the Mets and also received cash considerations back.
Byrd and Buck are expected to join the Pirates on Wednesday for the second game of the three-game series.
NOTES: Pirates LF Starling Marte, who has been on the disabled list since Aug. 19, will not be able to swing a bat for at least another two weeks, which could put his availability for the rest of the regular season in doubt. Marte was examined Monday by hand specialist Thomas Graham in Cleveland and no structural damage was found. ... Pittsburgh 1B Garrett Jones, mired in a 1-for-33 slump, was not in the starting lineup and 1B Gaby Sanchez took his place. ... The Pirates made two moves to clear space on the 40-man roster for Byrd and Buck by designating INF/OF Russ Canzler for assignment and recalling RHP Kyle McPherson from Triple-A Indianapolis and placing him on the 60-day disabled list. McPherson underwent Tommy John reconstructive surgery on his right elbow July 10. ... Milwaukee LHP Tom Gorzelanny (3-5, 3.60 ERA) will start Wednesday against Pittsburgh RHP Charlie Morton (5-3, 3.42).