Taillon (6-7) surrendered one run on four hits with two walks. The right-hander struck out the side twice, once in the third inning and again in the fifth, when he got out of a jam after allowing a leadoff walk to Tyler Saladino followed by a single from Erik Kratz.
Mercer was 3 for 4 with three singles, one of which knocked in two runs.
The Pirates have won four of their past five games to pull to 10 1/2 games back of the first-place Brewers, who have lost four of six, in the NL Central.
Felipe Vazquez earned his 21st save by getting the final two outs. Right-handed reliever Michael Feliz allowed Eric Thames to cut the Pirates' lead to 6-2 with a single up the middle before Christian Yelich made it 6-3 with a single off Vazquez and Jesus Aguilar grounded into a double play to end it.
Wade Miley (1-1) gave up two runs on four hits in five innings with five strikeouts and five walks for Milwaukee.
Miley allowed two two-out RBI singles to Mercer that put Pittsburgh ahead 2-1. Mercer's first opened the scoring in the second when he drove a ball down the left-field line, scoring David Freese. Aguilar tied it at 1 with a home run, his 24th, to left-center field in the fourth.
Mercer gave the Pirates a 2-1 lead when he lined a single off Saladino's glove and into left field to drive in Josh Bell in the fourth. He made it 4-1 in the sixth with a two-run single, driving in Bell and Josh Harrison, and scored on a two-out single to right from Starling Marte, pushing it to 5-1.
Harrison, who was 2 for 2 with two walks, made it 6-1 with a double to left in the seventh.
Brewers: INF Nate Orf and RHP Jorge Lopez were optioned to Triple-A Colorado Springs. RHP Freddy Peralta was optioned to Class-A Wisconsin. INF Eric Sogard was released.
Pirates: Manager Clint Hurdle said Pittsburgh is deciding whether to option OF Austin Meadows to Triple-A Indianapolis. Meadows did not start a fourth straight game Thursday since he went 1 for 4 against the Philadelphia Phillies on Sunday.
Brewers: RHP Junior Guerra (6-5, 2.79) could win a fourth straight start when he faces the Pirates on Thursday. In his past three starts, Guerra has surrendered a combined five runs, including one in his past two starts.
Pirates: RHP Nick Kingham (3-4, 4.26) will look to build on his last start when he takes the mound against the Brewers on Thursday. He allowed one run on four hits with five strikeouts, and had two RBIs, in a 4-1 win against the Phillies on Sunday.