Updated

Paul Maholm became the latest slumping pitcher to shut down the fast-fading St. Louis Cardinals, pitching effectively over seven innings, and the Pittsburgh Pirates won their season-high fourth in a row 5-2 on Tuesday night.

The Pirates remain two losses way from their first 100-loss season since 2001, but are 4-0 on a homestand that began with a three-game sweep of Arizona. Pittsburgh hadn't won four straight since a five-game run from Aug. 17-22, 2009, against the Brewers and Reds.

For the Cardinals, elimination is near. Their 24th loss in 36 games dropped their magic number for elimination in the NL Central to five. First-place Cincinnati was playing in Milwaukee.

The Cardinals probably didn't see this coming when they were in first place on Aug. 14, a few days after sweeping three in Cincinnati, but their season has come undone against teams and pitchers with poor records. They have dropped their last seven series against teams under .500, losing two of three during their last visit to Pittsburgh from Aug. 23-25.

They also keep being beaten by pitchers with elevated ERAs. A day after losing 4-0 to Florida's Chris Volstad, who began the game with a 5.11 ERA, they couldn't get to Maholm (8-15), who came into his 31st start of the season with a 5.36 ERA and a six-game losing streak.

Others who have beaten St. Louis recently include John Lannan, Jeff Samardzjia and Chris Narveson.

Evan Meek pitched the ninth inning for his fourth save in 10 opportunities after Joel Hanrahan worked a scoreless eighth.

Maholm, who had one win since July 18, gave up a run in the third and fifth on Albert Pujols' RBI double and force-play grounder but otherwise checked the Cardinals on seven hits, striking out four and walking none. It was his first start without a walk since he beat Houston 9-0 with a three-hitter on July 18.

The Pirates, 50 games under .500 when the homestand began Friday, quickly got to Cardinals starter Jake Westbrook (2-4) by scoring three times in the first. Westbrook hurt himself by walking Neil Walker and Garrett Jones to load the bases, and Pedro Alvarez and Ryan Doumit singled in runs. John Bowker was credited with an RBI when his hard-hit grounder roiled up the arm of shortstop Brendan Ryan for an error.

Jose Tabata made it 5-1 in the fourth with a two-run triple after Ronny Cedeno singled and Andrew McCutchen walked.

Westbrook, who needed 41 pitches to get through the first, was lifted after yielding five hits and five runs — one start after he shut out San Diego for eight innings. Two of Westbrook's four losses since being dealt by Cleveland to St. Louis have been in Pittsburgh, which remains on pace to lose more than 100 games for the first time since 1985 despite its modest winning streak.

NOTES: The Pirates could lose 100 games and have a winning record at home. They are 37-39 at PNC Park, but are a major league worst 15-59 on the road. ... Maholm was 2-9 in his previous 14 starts. ... Pujols is 16 of 24 against Maholm.