Francisco Liriano was looking for a mulligan. Starling Marte was looking for redemption.

They got what they were looking for Wednesday night and the Pirates got what they desperately needed: a win.

Liriano pitched his second complete game of the season and Marte delivered a two-run double as the Pirates beat the Cardinals 5-1 at Busch Stadium.

The Pirates (71-48) snapped a four-game losing skid with the win and extended their National League Central Division lead over the Cardinals (68-51) to three games. The Cincinnati Reds (68-52) are just one-half game behind St. Louis.

Five days after his ugliest outing of his season and perhaps his career Liriano delivered his best start of the season allowing one earned run on four hits to pick up his 13th win of the season tied for the most in the NL.

"That was masterful" Pirates manager Clint Hurdle said. "From start to finish. Talk about pitch efficiency. The first-pitch strikes were there. Punchouts were there. Swing and miss. Sixteen hitters retired on three pitches or less. Just outstanding."

Liriano allowed career highs in runs (10) and hits (12) Friday against the Rockies. But if he continues to pitch the way he did Wednesday that rough start might be just a blip on an otherwise impressive season.

Liriano used pinpoint fastball command to prevent St. Louis batters from getting solid contact on any of his pitches.

After getting a handful of ground balls in the first couple innings he got batters to chase. He struck out six batters and got four of them to whiff at his slider.

"It was sharp tonight" Liriano said of his slider. "It went where I wanted it to."

Catcher Tony Sanchez said Liriano pitched inside early to capitalize on the Cardinals' weaknesses. And as they game went along Liriano went to his strength -- a devastating offspeed pitch.

"Started in the zone and ended up out of zone" Sanchez said. "There was a good foot-and-a-half two feet of movement on that slider when it was good and it forced a lot of swings and misses."

Liriano saved a taxed bullpen which used six pitchers in the loss Tuesday night.

"Nasty pitches" said Marte who himself was looking for a do-over after dropping a routine fly ball Tuesday night turning a sure-win into an eventual loss.

Hurdle said Marte arrived at the ballpark Wednesday "in a good place" and he credited the veterans on his team for lifting Marte's spirits. He said he looked down in the dugout Tuesday night as players were talking to Marte after the fateful error.

"I just made him laugh" Andrew McCutchen said. "Sometimes that's all you've got to do."