Alvarez hit three homers and drove in seven runs as the Pirates (70-60) won their final two games earlier this week against St. Louis, but they have only three victories in nine games.
Alvarez, who has a career-high 26 homers, is also 11 for 19 (.579) over his last five games.
"We can definitely use these two wins as a sparkplug for games to come," he said.
The Pirates' staff will try to help their team keep rolling by building on their back-to-back shutouts against the Cardinals.
"You go against that offense and you put 18 zeros on the board in 18 innings, I couldn't be any prouder of them," manager Clint Hurdle said following a 5-0 win Wednesday.
Pittsburgh's 21-inning scoreless streak is its longest since July 17-19, 2009, and it hasn't surpassed that mark since June 30-July 2, 1997, when the club held the Chicago White Sox without a run for 25 consecutive innings.
Karstens (5-3, 3.47 ERA) will try to keep that streak going with another superb outing against Milwaukee (62-68). The right-hander scattered seven hits and walked none during a 4-0 victory Saturday at PNC Park but left after tweaking his right groin in the eighth inning.
"Jeff gave us exactly the start we needed," manager Clint Hurdle told the team's website.
That loss was one of only two the Brewers have suffered in their last 10 games. The other came Thursday in a wild 12-11 loss at Chicago that snapped a four-game win streak.
Milwaukee blew a six-run advantage in the sixth inning but regained the lead on Cody Ransom's solo homer in the seventh only to give up three runs in the ninth. Jonathan Lucroy matched a career high with seven RBIs, including a grand slam, and Rickie Weeks had a career-best five hits.
"Once we got the big lead and they came back we just didn't have the momentum," manager Ron Roenicke said.
Mark Rogers (2-1, 4.28) will try to help his team bounce back by earning a third straight win and his second in as many starts against Pittsburgh, which is 11-16 in August. The right-hander gave up three hits over five innings during a 7-0 win Sunday, his only matchup versus the Pirates in his brief career.
Milwaukee won two of three during that series at PNC Park but has split its six home matchups after winning 36 of the previous 39 at Miller Park over Pittsburgh.
Andrew McCutchen has homered in each of his past four games in Milwaukee and is 12 for 24 with nine RBIs there this season. The Pirates outfielder, though, is batting .252 in August after hitting .371 over the season's first four months.
Lucroy is a career .370 hitter against Pittsburgh, his best average versus any NL team, but he's 0 for 5 with three strikeouts against Karstens. Corey Hart, hitting .389 versus the Pirates this season, is 2 for 22 versus the right-hander.
Aramis Ramirez, meanwhile, is 7 for 16 (.438) with two homers against Karstens and hitting .407 (11 for 27) in his last seven games versus one of his former clubs.