Pedro Alvarez homered for the second straight day and the Pittsburgh Pirates beat the St. Louis Cardinals 7-1 Friday to even their NL division series at a game apiece.

After taking advantage of several Cardinals mistakes, the Pirates head home for Game 3 on Sunday. Wild-card game winner Francisco Liriano faces Cardinals right-hander Joe Kelly.

The Pirates literally turned the tables on the Cardinals in Game 2, reversing their hits and hits allowed compared to their Game 1 loss. Here’s a look:

Roles were reversed from the Cardinals’ 9-1 win in the opener, with the Pirates showing poise in their first postseason appearance since 1992 and St. Louis looking tentative in the field.

Cardinals starter Lance Lynn, who hasn’t lasted long enough to qualify for the victory in any of his three career postseason starts, yielded five runs and seven hits in 4 1/3 innings.

He found trouble early. Alvarez doubled in the second on a fly ball that was misjudged by center fielder Jon Jay and he scored on Cole’s single to put the Pirates ahead — eighth-place hitter Jordy Mercer was walked intentionally ahead of Cole. Alvarez then hit a 418-foot two-run homer in the third.

Third baseman David Freese dropped Marlon Byrd’s pop fly for an error in gusting wind in the seventh inning, leading to a run.

Cole faced the Cardinals for the first time and left most of them shaking their heads, striking out five and walking one. After allowing Carlos Beltran’s double with one out in the first, he retired 11 straight before Yadier Molina led off the fifth with his third career postseason homer.

Relying on a fastball that peaked at 99 mph on the stadium radar gun and one that TBS had at 100, Cole had hitters helpless at times even without shadows that benefited pitchers early in Game 1. He retired the side in order on seven pitches in the third, finishing by striking out Lynn and leadoff man Matt Carpenter. The 22-year-old rookie didn’t allow a ball out of the infield in the fourth.

Pirates pitchers totaled 10 RBIs during the season and Cole had five of them, including two in his final start.

Lynn is 0-2 the last two postseason, allowing nine earned runs in 12 2/3 innings. He faced the Giants in the NL championship series last fall, the longest lasting 3 2/3 innings.

Lynn was manager Mike Matheny’s choice for Game 2 ahead of rookies Shelby Miller and Michael Wacha, the decision based on the right-hander’s strong September and 9-3 record at home.