Manager Tony La Russa let Pineiro take the mound for the start of the eighth inning to give the crowd a chance to show its appreciation before pulling him.Pineiro (8-9) gave up one run, struck out three and allowed five hits in getting his third win in five decisions after losing five straight and eight of nine. It also marked his first win since April that he didn't pitch a complete game.
Ryan Franklin got four outs for his 22nd save in 23 attempts this season.
Petit (0-4) had one of his best outings this season. He lasted six innings, his longest outing this year, and his six strikeouts marked his best since whiffing six in his season debut April 11 against Los Angeles.
He allowed three hits, tying his best mark this season since his season debut, and walked four before being pulled for reliever Juan Gutierrez to start the bottom of the seventh.
Pujols singled in the fourth for the Cardinals' first hit. Two outs later Molina and Mark DeRosa walked to load the bases to bring up Pineiro, hitting in the eighth spot. It was the pitcher's second double of the season and raised his RBI total to three.
The Diamondbacks, who have won only one of the nine games in which Petit has appeared this season, scored their lone run in the fifth. Chad Tracy's ground-rule double down the left-field line scored Gerardo Parra from third, and the Diamondbacks had runners on second and third with one out. Pineiro got Petit to ground back hard to the mound and Felipe Lopez grounded out to short to end the Arizona's threat.