PITTSBURGH (AP) -- Jon Jay already had a bat in hand before St. Louis Cardinals manager Mike Matheny even called his name.
A minute later the veteran outfielder was standing on second base after his pinch hit tied the game. Jay didn't stay there long, racing home with the go-ahead run on Matt Holliday's sharp single in a 3-2 victory over the Pittsburgh Pirates on Monday night.
''He just sensed,'' Matheny said of Jay's precocious grab of the bat. ''We hadn't had any interaction at that point. He's smart, he knows the game.''
And the Cardinals know a thing or two about coming through late. St. Louis scored all three runs off reliever Jared Hughes (6-4) with two outs in the seventh inning to back John Lackey and send the scuffling Pirates to their seventh loss in 10 games.
Lackey (2-1) worked out of trouble early to last seven innings in his second victory for the Cardinals after arriving in a trade from Boston on July 31. He was 11-7 with the Red Sox.
Trevor Rosenthal gave up a leadoff home run in the ninth to Andrew McCutchen but held on to earn his 39th save.
''I think guys know when we have a pitcher like Lackey on the mound, he's going to keep us in the game,'' Matheny said. ''We've just got to keep fighting and figure out a way to get something going.''
Pedro Alvarez hit his 18th homer in the second off Lackey, but the Pirates managed little after that to fall further behind St. Louis and first-place Milwaukee in the NL Central race.
Pirates starter Francisco Liriano overwhelmed St. Louis for six-plus innings before leaving after Kolten Wong's infield single led off the seventh. Hughes came on and promptly picked off Wong.
Things didn't work out so well for the normally dependable right-hander, however, when he went to the plate.
Tony Cruz started the game-changing rally by turning an 0-2 count into a single, moved to second on a sacrifice bunt and scored on a sharply hit single by Jay. Holliday then gave St. Louis the lead with a grounder past shortstop Jordy Mercer. St. Louis has 209 RBIs this season with two outs, tops in the National League.
''It was just a night where (Hughes) couldn't get the ball where he wanted to go,'' Pirates manager Clint Hurdle said.
The cushion was more than enough for Lackey, who had little trouble after navigating a choppy second inning. Alvarez hit a long home run to center with one out, and infield hits by Starling Marte and Jordy Mercer followed. The runners moved up on a sacrifice by Liriano, but Josh Harrison's sharply hit fly to left went right to Holliday.
Lackey settled down following the reprieve, not allowing a runner past first base over his final five innings. He walked one and struck out three to improve to 3-0 against National League teams this season.
''I think Tony and I made some good adjustments after the first time through the lineup,'' Lackey said. ''The last three innings were as good as I felt.''
Cardinals 1B Matt Adams spent the last four innings with cotton stuffed in his nose following a nasty collision with the fence down the right-field line.
St. Louis backup outfielder Shane Robinson left in the top of the ninth after injuring his left arm while trying to steal second. Matheny said Robinson was ''in pretty bad shape'' and might have to return to St. Louis for further examination.
Cardinals: C Yadier Molina and RHP Michael Wacha will head to Double-A Springfield this week to begin rehab assignments.
Molina has been on the disabled list since tearing a ligament in his right thumb July 10 and will go through a full workout with Springfield on Tuesday. If he makes it through without a problem, Molina will likely play on Wednesday and could be back with the Cardinals before rosters expand on Sept. 1.
Wacha hasn't pitched since heading to the DL in mid-June with a stress reaction in his right shoulder. He is scheduled to throw batting practice Wednesday and will make at least one minor league rehab start before being activated.
''It's a great step forward,'' Matheny said about the progress of both players. ''Obviously, we'll see how they both feel after they get an opportunity to get into a game. It's definitely good news.''
Pirates: RHP Charlie Morton, on the 15-day DL since Aug. 20 with a sports hernia in his right hip, threw a bullpen session and will start for Double-A Altoona on Thursday. Morton will work five innings or 75 pitches.
Cardinals: RHP Lance Lynn (14-8, 2.78 ERA) will look to remain unbeaten in August. Lynn is 3-0 with a 1.75 ERA in four starts this month.
Pirates: RHP Gerrit Cole (7-4, 3.69 ERA) tries for his first victory since July 4. Cole is 1-1 with a 1.93 ERA in two regular-season starts against the Cardinals.