ST. LOUIS -- The team which got swept by one of the worst teams in baseball had no problems beating the best team in baseball.
In trimming St. Louis' National League Central Division lead to 5 1/2 games, Pittsburgh (80-53) looked nothing like the team which lost its prior four games, three coming earlier this week at Milwaukee.
Happ (8-7) authored seven shutout innings, allowing only three hits and fanning eight with no walks. In improving to 4-1 since being traded from Seattle on July 31, Happ lowered his ERA with the Pirates to 1.57.
"A change of scenery can give a guy a shot in the arm," Pittsburgh manager Clint Hurdle said.
Asked about Hurdle's theory, Happ didn't disagree.
"There's definitely some excitement on this team and the possibilities for it," he said. "It's been a fun experience so far."
The entire night was fun for those wearing black and gold. The Pirates scored twice in the first on RBI singles by third baseman Jung Ho Kang and left fielder Starling Marte, setting the tone for only its second win in seven games under the Gateway Arch.
Marte ripped a two-run double in the fifth for a 4-0 lead, highlighting a 3-for-5, three-RBI night. That was more than enough for Happ, who retired 15 men in a row after second baseman Kolten Wong lined a single to center in the second.
"I was pitching off my fastball and getting ahead of guys," Happ said. "I thought we mixed up our pitches pretty well. I tried to execute as best as I could."
It was a marked difference from his first 10 starts against the Cardinals, who torched him for 50 earned runs over 80 2/3 innings while Happ pitched for Philadelphia and Houston. Happ entered the game 1-8 against St. Louis with a 6.79 ERA.
Meanwhile, Cardinals right-hander Carlos Martinez (13-7) gave up seven hits and four runs in five innings, walking three and whiffing five.
Martinez skipped his start on Tuesday night with a sore back and hadn't pitched since Aug. 27, when he beat Arizona 5-3. Martinez's fastball touched 99 mph at times in the first inning, but his location failed him at times, knocking his pitch count to 100.
"The first inning was a little rough for him," St. Louis manager Mike Matheny said of Martinez. "Two busted bats ended up scoring runs. He actually did a nice job, but he ended up with 36 pitches after the first inning, so it was an uphill battle after that."
It was just the third loss in 12 games for the Cardinals (86-48), who didn't move a runner to third base until the eighth, when left fielder Stephen Piscotty doubled home pinch-hitter Mark Reynolds to make it 5-1.
But Pittsburgh squashed any ideas of a dramatic rally with four runs in the top of the ninth, capped by a two-run double from pinch-hitter Travis Snider.
Pinch-hitter Cody Stanley's two-run double in the bottom of the ninth capped the evening's scoring.
By that time, Happ was in the clubhouse after giving the Pirates exactly what they needed.
"His mix of pitches and his command were very good," Hurdle said of Happ. "The downhill angle on his fastball was very impressive. He's definitely grabbed our attention. He executed very well."
NOTES: Pittsburgh CF Andrew McCutchen (Achilles' tendon tightness) was back in the lineup Friday night after sitting out his team's 5-3 loss Thursday evening in Milwaukee. ... St. Louis OF Jon Jay (left wrist) was activated off the 15-day disabled list on Friday. In four rehab games at Triple-A Memphis, Jay collected five hits in 13 at-bats, including a homer, and stole two bases. ... Pirates RHP A.J. Burnett (right elbow inflammation) threw a simulated game Friday, a big step forward toward his return. Burnett has been on the 15-day DL since July 31.