Thames' homer was his first since Aug. 29 and only his second in the past month. He added an RBI single in the third inning to cap his first multi-hit game since Aug. 18.
Both hits came at the expense of Gerrit Cole (11-10). The Pirates right-hander struck out 10 batters but gave up all five Milwaukee runs on seven hits and two walks in six innings.
The Brewers' bullpen worked six scoreless innings in relief of left-hander Brent Suter, who allowed two runs, three hits and a walk in three innings. It was Suter's second start and third appearance since returning from the disabled list earlier this month.
Jeremy Jeffress (3-0) struck out three in 1 2/3 innings, and Corey Knebel posted his 35th save with a perfect ninth.
Thames' home run gave Suter a 1-0 lead in the second inning, but the Pirates jumped in front in the third. Sean Rodriguez came home on Jordy Mercer's groundout. An RBI single by Jordan Luplow put Pittsburgh on top 2-1, but Suter stranded runners at second and third to get out of the inning.
Milwaukee put up four in the bottom of the inning, with Ryan Braun hitting an RBI grounder and Santana adding a two-run double.
The Brewers added one more on Thames' base hit, but the rally came to an end when Santana tried to score on the play.
NOTES: Brewers manager Craig Counsell announced RHP Chase Anderson would start on short rest Wednesday in the series finale against the Pirates. Anderson needed just 65 pitches to cover five innings as the Brewers routed the Cubs on Saturday in his last start. ... Milwaukee RHP Jimmy Nelson will seek a second opinion on his injured right shoulder Wednesday in Los Angeles. Nelson was lost for the season when he tore his labrum and strained the rotator cuff in his shoulder Friday at Chicago. ... RHP Chad Kuhl will start Friday for the Pirates when they open a three-game series at Cincinnati. Manager Clint Hurdle was considering skipping Kuhl's next turn but opted to bump RHP Trevor Williams instead. ... Pittsburgh announced that pitching coach Ray Searage agreed to terms on a contract extension.