Polanco connected off David Phelps (2-3) for his fourth homer of the season and finished 2 for 3 with a walk. It was Polanco's second two-hit game in as many days, lifting his batting average from .085 to .151.
In a roundabout way, Polanco called his shot while talking to teammate Jose Osuna in the on-deck circle.
''I told him I was about to hit a ball very hard,'' Polanco said. ''It's something you've got to do to motivate yourself. It's something you've got to do to go into the batter's box with confidence. I'm feeling good now.''
Manager Derek Shelton believes Polanco has needed some time to regain his hitting stroke after beginning the season on the COVID-19 injury list.
''We talked about how we felt his timing was good at the end of (spring training) 2.0 and then he lost it because he lost 10 days because of the positive test,'' Shelton said. ''We're starting to see the timing is back and the ability to take really aggressive swings.''
The Pirates nearly doubled their season win total in one weekend. They entered the series with a 4-17 record, worst in the major leagues.
''There were a lot of good things that happened,'' Shelton said.
Cole Tucker started the winning rally with a one-out single and Polanco hit a shot to center field one out later off a 1-1 cut fastball.
''It's a pitch I pride myself in being able to make and I just didn't make it,'' Phelps said. ''I tried to hit the corner with it and let is loose, back middle, and he put a good swing on it. Y'all saw the result.''
Milwaukee's Justin Smoak hit a two-run home run in the sixth inning that put his team ahead 4-2. He had two hits and three RBIs.
Bryan Reynolds' RBI single in the bottom of the sixth drew Pittsburgh within a run.
Chris Stratton (1-0) pitched a scoreless eighth for the win and Richard Rodriguez worked a perfect ninth for his first save of the season and second of his four-year career.
Closer Keone Kela was unavailable because of forearm tightness.
Pirates rookie JT Brubaker remained winless in five career appearances, including three starts. He gave up two runs and four hits in four innings with six strikeouts and one walk.
Corbin Burnes pitched 5 1/3 in his second start since being moved to the rotation from the bullpen. He allowed five hits while walking seven and striking out two.
RBI singles by Adam Frazier in the first inning and Jarrod Dyson in the second put the Pirates on top 2-0.
Smoak doubled in a run in the fourth and Omar Narvaez hit an RBI single in the eighth to draw the Brewers even.
The Brewers' Christian Yelich, the 2018 NL MVP, went 0 for 3 and is 1 for 25 against the Pirates this season.
Milwaukee went 4-6 on its longest road trip of the season.
The start of the game was delayed one hour and 25 minutes by rain. With fans unable to attend, a loud cheer was played over the public address system when the tarp was pulled.
The Brewers have had an inconsistent season. After winning three in a row from the NL Central-leading Cubs in Chicago last weekend, Milwaukee has lost five of its last six games to leave its record at 11-15.
GM David Stearns admitted before the game that nerves are getting frayed as the Brewers try to make three consecutive postseason appearances for the first time in franchise history.
''There's probably as much frustration in our clubhouse right now as I've experienced during my time in Milwaukee,'' the fifth-year GM said. ''I think that's individual-level frustration for guys who aren't performing up to up to their capabilities, and then there's collective frustration when we look at how we've played together as a team.
''The challenge for us now is to use that frustration in a somewhat productive manner.''
Brewers: RHP J.P. Feyereisen was recalled from the alternative training site in Appleton, Wisconsin, and LHP Angel Perdomo was optioned there. Perdomo allowed three runs in 2/3 of an inning Saturday in Milwaukee's 12-5 loss to the Pirates, raising his ERA to 20.25 in three games.
Pirates: RHP Nick Tropeano was recalled from the alternate training site in Altoona, Pennsylvania, and RHP Nick Mears was optioned there. Tropeano was claimed off waivers from the New York Yankees on Aug. 11.
Pirates: 1B Colin Moran (evaluation for concussion) left the game after the second inning and SS Kevin Newman (right lower abdominal muscle discomfort) exited after the third. Moran was injured in a collision with the Brewers' Avisail Garcia at first base. Newman was hurt when he struck out swinging. . RHP Kyle Crick will throw a live batting practice session Monday then accompany Pittsburgh on its next road trip, which begins Tuesday. Crick has been out since July 28 with a right shoulder/lat strain.
Brewers: LHP Brett Anderson (1-2, 3.71 ERA) is scheduled to start Monday night in the opener of a four-game home series with the Reds. RHP Trevor Bauer (3-0, 0.88) will start for the Cincinnati.
Pirates: Off Monday before opening a two-game against the White Sox on Tuesday night in Chicago. LHP Steven Brault (0-0, 3.00) is scheduled to start for Pittsburgh and face RHP Lucas Giolito (2-2, 3.89).
Copyright 2020 STATS LLC and Associated Press. Any commercial use or distribution without the express written consent of STATS LLC and Associated Press is strictly prohibited.