It was the opener of a five-game series between the NL Central foes.
Mercer, a night after hitting two doubles, was 3-for-4 for Pittsburgh, which has won four of its past five games. Josh Harrison was 2-for-2 with an RBI, a run and two walks.
Jesus Aguilar hit his National-League leading 24th homer for Milwaukee, which lost for the fourth time in six games.
Taillon (6-7) gave up Aguilar's homer among four hits and walked two in six innings.
Felipe Vazquez entered in the ninth with the bases loaded and one out and gave up a run but got also a game-ending double play for his 21st save.
Milwaukee starter Wade Miley (1-1), activated from the 60-day disabled list earlier in the day, gave up two runs and four hits in five innings, with five strikeouts and five walks.
Pittsburgh took a 1-0 lead in the second on Mercer's two-out RBI single to left.
Aguilar tied it in the fourth when he crushed the ball 466 feet to left-center with one out.
With two outs in the bottom of the fourth, Josh Bell and Harrison walked, and Mercer followed with an RBI single to make it 2-1.
The Pirates added four runs over two innings against reliever Adrian Houser, who was recalled earlier in the day.
In the sixth, Bell walked and Harrison singled to lead off the inning, then advanced on a wild pitch. Mercer singled to center to drive in both for a 4-1 lead. After Corey Dickerson grounded into a double play, Starling Marte drove in Mercer with a single to push it to 5-1.
In the seventh, Bell drew a two-out walk off Houser, and Harrison doubled him home, making it 6-1.
Milwaukee scored two in the ninth on RBI singles by Eric Thames and Christian Yelich.
--Field Level Media