"To be frank, I think they showed us why they're a better team," Arizona manager A.J. Hinch said. "They beat our best, and they did it methodically."
Colorado expanded its wild-card cushion over its three nearest pursuers because San Francisco, Florida and Atlanta all lost. The Rockies lead the Giants by 4½ games, the Marlins by five and the Braves by 5½.
After winning a franchise-record 40th road game, Colorado opens a nine-game homestand on Tuesday.
The Rockies lost five of six during their road trip but finished 4-5 after consecutive wins over Arizona. They are in the same place they were when the trip began, Colorado manager Jim Tracy noted, 4½ games up in the wild-card race.
"We go back home with nine of our final 12 games left at home," he said. "You've got to feel pretty doggone good about that."
In the NL West race, Colorado remained five games behind the first-place Los Angeles Dodgers.
Giambi, who had a three-run, pinch-hit homer in the ninth inning of Colorado's 10-4 victory Saturday night, added a two-run shot off Haren in the eighth. That gives him 11 RBI in his 12 games since joining the Rockies earlier this month.
"This is a great teammate, this is a unique player," Tracy said. "This is a guy that lives for this time of the season, and I really think right now he's in a really good place."
After being released by Oakland, where he was hitting .193, Giambi was lured to Colorado by the chance to play for Tracy on a team that could contend. His role off the bench behind first baseman Todd Helton suited him perfectly.
"It's a great team, that's why I chose to come here," Giambi said, "Not only the guys, but the way they played the game, and Jim Tracy was a huge reason. It's been incredible. It's been a lot of fun. They've welcomed me with open arms and it's been great."
Jimenez (14-11) gave up a run on five hits through seven innings, striking out eight and walking three.
"I can't say enough about how special that game is to win," Tracy said. "We beat a star in this league today. In order to do so, we had to hang right with him, and that goes back to our starting pitcher."
Jimenez stranded five runners in the first two innings, then settled down to retire 13 in a row.
"By the third inning, he found his fastball to go along with the breaking pitches he was throwing for strikes, and he started mowing people down," Tracy said.
Haren (14-9) retired his first 12 batters and had a two-hit shutout until the Rockies scored three in the seventh, the last run on Clint Barmes' suicide squeeze. Haren gave up five runs and eight hits, striking out seven and walking two.
"They put together much better at-bats as the game went along," Haren said. "I had decent stuff and they fought me there all the way to the end. I gave it my best, it just wasn't enough."
After Haren's RBI single put Arizona up 1-0, the Diamondbacks loaded the bases with two outs, but Justin Upton struck out.
Troy Tulowitzki led off the inning with an infield single, then advanced to second on shortstop Stephen Drew's throwing error. Haren fanned Giambi, but Ryan Spilborghs singled to put runners at first and third.
Torrealba singled to right to tie it, then Stewart singled under the glove of first baseman Brandon Allen to put Colorado up 2-1. Torrealba beat Haren's toss to the plate on the surprise squeeze to make it 3-1.
Strangely, Barmes didn't run to first on the play and Arizona didn't notice. Finally, Barmes started to run and catcher Miguel Montero threw him out.
"He was so impressed with it he stood there admiring it," Tracy joked.