The multi home run game was the eighth for Pujols, who leads the majors with 34 homers and 89 RBI. He has 31 multi home run games in his career.
"I had him in the situation that I wanted every time," Garland said. "Nobody on, leading off innings and he caught me. What are you going to do?"
Pujols spent Wednesday and Thursday resting after being the face of the All-Star Game earlier in the week and he was ready to get back to work.
"I felt good," Pujols said. "Obviously, a couple of days off, you can't go wrong. But you can't think about that; your main focus is to make sure you're ready to go."
Chris Carpenter (8-3) blanked the Diamondbacks over eight innings, allowing seven hits and striking out seven.
"Early on, I left some balls in the middle of the plate that they hit," Carpenter said. "But I felt like I got better."
"It goes to show what a competitor he is," St. Louis manager Tony La Russa said.
Ryan Ludwick drove in two runs and extended his hitting streak to 10 games with a two-run single, and Nick Stavinoha hit a two-run pinch homer for St. Louis. Yadier Molina matched his career high with four hits, all singles.
Pujols, who struck out in his first at-at, led off the fourth against Garland (5-9) by hitting a pitch 386 feet into the Cardinals' bullpen in right.
When Pujols came up to lead off the sixth, Garland appeared like he would pitch around him, with his first three pitches out of the strike zone. But Garland threw his next one over the plate and Pujols swatted it 435 feet off the facade of the upper deck in left field.
Although it was his first home run this off a 3-0 count, Pujols said he was not surprised to get a strike.
"Why should I be surprised?" he asked. "You have to be ready every pitch."
Garland expected Pujols to be hacking.
"They were going to let him swing," he said. "I knew that."
The Diamondbacks took no such chances an inning later, as reliever Scott Schoeneweis intentionally walked Pujols with two outs and runners on first and third to load the bases. That backfired when Ludwick dumped a single to right off reliever Esmerling Vasquez to make it 4-0.
Pujols had one more chance in the eighth but he flied out to left against Clay Zavada with runners on first and second and two outs.
"He's tough to deal with," Arizona manager A.J. Hinch said. "He's one of the best hitters in baseball, if not the best hitter in baseball. He made us pay a couple of times."
Garland went six innings, allowing two runs and seven hits.
- Cardinals INF Khalil Greene has been sent to Double A Springfield to begin an injury rehabilitation assignment. In 47 games, Greene is hitting .200 in 130 at-bats with five home runs and 19 RBI.
- Arizona OF Jason Upton, fresh off his first All-Star Game, struck out his first three plate appearances and finished 0 for 4.
- Molina picked Mark Reynolds off first in the sixth, his six pickoff this season and 32nd of his career.
- The intentional walk was Pujols' 33rd, tops in the majors.