Updated

Pittsburgh, PA (SportsNetwork.com) - Matt Holliday's two-run single capped a three-run seventh inning, as the Cardinals rallied past the Pittsburgh Pirates, 3-2, at PNC Park.

Pinch-hitter Jon Jay delivered the tying RBI single for St. Louis, which has won six of its last eight games.

Cardinals starter John Lackey (2-1) pitched seven frames and gave up seven hits, including a second-inning home run to Pedro Alvarez.

"I had good adjustments after the first time through the lineup," Lackey said. "I'm still learning some of these lineups."

Francisco Liriano surrendered four hits and compiled eight strikeouts over six-plus scoreless frames, but Jared Hughes (6-4) yielded three hits in the fateful seventh.

Andrew McCutchen homered on Trevor Rosenthal's first pitch in the bottom of the ninth. Russell Martin walked with one out, but Alvarez bounced a first offering back to the mound for the second out. With Martin at second, Starling Marte flied out to center to cap the opener of this three-game series between teams fighting for a trip to the postseason. Rosenthal picked up his 39th save.

"We want Pedro to swing the bat. It was a good hittable pitch that he just happened to smother," Pirates manager Clint Hurdle said. "We weren't able to play a complete enough game to win."

The Cardinals entered the day 1 1/2 games behind NL Central-leading Milwaukee, while the Pirates were 1 1/2 back of San Francisco for the second wild card spot.

The Pirates have lost two straight and nine of their last 12 games.

Neil Walker grounded into a double play to kill a Pittsburgh rally in the first.

Alvarez homered to left field and the Pirates escaped a jam in the sixth to keep the lead. With the bases full, Oscar Taveras grounded into a 5-2-3 double play.

Kolten Wong singled to start the seventh, but Hughes picked him off. Tony Cruz singled to left and moved to second on Lackey's sacrifice bunt. After Matt Carpenter walked, Jay lined a hit to center. McCutchen couldn't pick up the ball cleanly and the Cardinals ended up with two men in scoring position.

Holliday made the Pirates pay by bouncing a ball into left field for a 3-1 lead.

Game Notes

The Cardinals recalled pitcher Tyler Lyons from Triple-A Memphis and optioned infielder Greg Garcia to Double-A Springfield ... The Pirates also made a number of roster moves Monday, including selecting outfielder Jose Tabata from Triple-A Indianapolis. They also optioned outfielder Gregory Polanco to Indianapolis, reinstated infielder Clint Barmes from the 15-day disabled list, and designated infielder Jayson Nix for assignment ... The Pirates have gone 5-0-1 in the last six series played against the Cardinals at PNC Park ... Alvarez has started the last three games at first base and has gone 4-for-10 with three homers and five RBI ... Shane Robinson was caught stealing second in the top of the ninth and then grabbed his left elbow. He received medical attention before walking off the field ... McCutchen had three of Pittsburgh's eight hits.