Charles LeClaire-USA TODAY Sports

Michael Perez hit three homers and the Pittsburgh Pirates held on to defeat the visiting Milwaukee Brewers 8-7 on Thursday.

Oneil Cruz and Jack Suwinski also homered for the Pirates, who have won two in a row after beating Milwaukee for the first time in seven tries this year.

Pittsburgh starter JT Brubaker (2-7) gave up four runs and seven hits in six innings, with six strikeouts and two walks.

Yerry De Los Santos got the final out for his second save.

Christian Yelich hit an RBI triple, Omar Narvaez and Willy Adames each had an RBI double and Kolten Wong hit an RBI single for the Brewers, who had their four-game winning streak snapped.

Milwaukee starter Adrian Houser gave up three runs and five hits, with no strikeouts and one walk, in 2 1/3 innings before leaving because of right elbow tightness.

Brent Suter (1-2) allowed two runs in 2 2/3 innings.

In the second inning, Josh VanMeter singled ahead of Cruz's second homer, an estimated 431-foot shot to right-center, for a 2-0 Pittsburgh lead. Suwinski made it back-to-back homers to increase it to 3-0.

Milwaukee got two back in the third. Jace Peterson doubled and scored on Yelich's triple. Yelich scored on Adames' groundout to make it 3-2.

The Brewers tied it in the fourth, when Wong doubled and scored on Narvaez's double.

In the fourth, Suwinski drew a one-out walk, and Perez's homer put the Pirates back on top, 5-3.

Andrew McCutchen led off the sixth with a double, moved to third on Wong's flyout to right and scored on Luis Urias' groundout to draw Milwaukee to within 5-4.

In the bottom of the sixth, Suwinski singled. Perez homered to right for a 7-4 Pittsburgh lead.

In the eighth, Perez took one deep to right to up the score to 8-4.

In the ninth, Peterson and Yelich each singled, and Peterson scored on Adames' double. Yelich scored on Rowdy Tellez's groundout. Milwaukee got within a run, 8-7, on Wong's infield single.

More must-reads:

TODAY'S BEST
Pacers ride historic shooting performance to Game 7 blowout of Knicks
Timberwolves mount incredible second-half comeback to stun Nuggets in Game 7
Xander Schauffele proves doubters wrong with historic win at 2024 PGA Championship
Four things we learned from Joey Logano's All-Star Race win at North Wilkesboro
Phil Foden lifts Manchester City to fourth consecutive English Premier League title
Watch: Aaron Judge blasts 13th home run in Yankees' seventh straight win
Canucks won't have linchpin forward for Game 7 vs. Oilers
Jags reportedly mulling extension for Trevor Lawrence, but is that the right choice?
Gordon Hayward calls role with Thunder 'frustrating'
Mets reliever Edwin Diaz showing short shelf life of closers
Three offseason moves the 49ers must make
Watch: NASCAR drivers exchange punches after crash in All-Star Race
Knicks star offers passionate defense of HC Tom Thibodeau after Game 7 loss
Knicks' Jalen Brunson suffers serious injury in Game 7 vs. Pacers
Dodgers add recently acquired left-hander to active roster
Report: 2023 No. 7 pick expected to terminate KHL contract, join Flyers
Mavericks advance to Western Conference Finals aided by controversial call late
Connor McDavid, Oilers hammer Canucks to force Game 7
Tyson Fury-Oleksandr Usyk epic increases excitement for potential rematch
Seize the Grey wins in muddy Preakness