The Pirates won after reigning NL MVP Andrew McCutchen left in the fifth inning because of discomfort in his left ribs. Recently on the disabled list because of a rib problem, the center fielder ran into the wall earlier in the game.
Davis sent a 2-2 pitch from Maness (5-3) deep over the fence in right-center for his ninth home run of the season and his third as a pinch-hitter.
Josh Harrison homered for the Pirates.
Pittsburgh, trying desperately to stay in the hunt for a wild-card slot, appeared in danger of a second straight disheartening defeat after a brilliant effort by Cole.
The 23-year-old overwhelmed the Cardinals for long stretches in his second start since returning from the disabled list with right lat soreness. St. Louis didn't get a hit until a two-out double just inside the first base bag by Kolten Wong in the sixth. Cole responded by fanning Matt Holliday for his ninth strikeout of the game.
Pirates manager Clint Hurdle decided to send Cole back out for the seventh with a 2-0 lead even though he had thrown 102 pitches. Trouble soon followed.
Adams scored on a sacrifice fly by Jay, and Grichuk — called up earlier in the day after outfielder Shane Robinson was placed on the disabled list with a shoulder injury — slapped a single up the middle to tie the game. Watson recovered to get out of the jam and retired the side in the eighth.
The Cardinals decided to stick with Maness after a brief conference. It didn't work. Davis, whose at-bats have dwindled with the team experimenting with Pedro Alvarez at first, hit a towering shot to boost a team that has fallen off the pace in the crowded NL playoff chase over the last three weeks.
McCutchen aggravated the rib injury that sent him to the disabled list earlier this month. He slammed into the wall to take away a hit from Matt Carpenter in the third.
McCutchen remained in the game for two more plate appearances but grimaced in obvious pain after a flyout in the fifth.
Cardinals: St. Louis put Robinson on the 15-day disabled list with a partially dislocated left shoulder. He hurt himself while trying to steal second late in a 3-2 win over the Pirates on Monday. He went back to St. Louis for an MRI on Tuesday. Manager Mike Matheny said there is no timetable for Robinson's return. Grichuk hit 25 home runs in Triple-A this season.
Pirates: Alvarez exited in the seventh inning with left foot discomfort. Making his sixth start at first base following serious throwing issues while playing at third base, Alvarez went 0 for 3 and handled every defensive chance cleanly before giving way to Gaby Sanchez. Alvarez will be re-evaluated on Wednesday.
Cardinals: Adam Wainwright (15-8, 2.52 ERA) goes for his major league-leading 16th win on Wednesday. Wainwright's nine road victories are tied for second in the majors and his 1.74 road ERA is tops among all starters.
Pirates: Jeff Locke (5-3, 3.69 ERA) is 3-1 with a 3.78 ERA in eight starts at PNC Park this season. The left-hander allowed two runs in six innings in an 8-3 victory over Milwaukee last Friday.
Link to box score: Pittsburgh (68-64) 5, St. Louis (71-60) 2
Join the pre-game, in-game and post-game discussion about each contest at The Cardinal Nation message board.