A vibe much like that of the 2010 club that propelled itself into the postseason with a stellar September.
Carlos Beltran hit a go-ahead, two-run homer among his four hits, Cain calmly recovered from a rough first inning and the Giants beat the first-place Diamondbacks 6-2 on Friday night to snap Arizona's season-best nine-game winning streak.
Cody Ross hit a two-run homer and made a nice play with his glove as the reigning World Series champions pulled within five games of Arizona in the NL West race. San Francisco figures it must take the series to stay in the chase for a chance at defending its division title.
"That's the energy we needed, the way we needed to start off September," Cain said. "This is the time to do it, obviously. We only have a month left."
The Giants began last September with a four-game division deficit behind San Diego, which gives this group hope of pulling off another unlikely run.
Jeff Keppinger added an RBI double off Joe Saunders (9-12) for the Giants, who denied the D-backs brass a trip to the barber shop. San Francisco won a series opener for the first time in its last 13 chances since taking Game 1 on July 18 against the rival Dodgers.
Cain (11-9) won for only the second time in seven starts, escaping a bases-loaded jam in the first with minimal damage.
Whether this crucial victory will help save San Francisco's season remains to be seen.
"This is fun as a ballplayer. You want to be in a situation where every game is meaningful, every game is worth something," Beltran said. "I heard they played well in September. We're looking forward to that."
Arizona won't be pulling out those razors this time.
First-year general manager Kevin Towers and team president Derrick Hall vowed to shave their heads if the club's win streak reached 10 -- a little friendly bet they had going with manager Kirk Gibson.
"We made some mistakes which were very uncharacteristic of the way we have been playing baseball," Gibson said. "We walked six people tonight and we gave them some added opportunities. They outplayed and outpitched us tonight. We'll be back tomorrow."
The D-backs beat both Cain and Lincecum in consecutive games during their trip here a month ago. That after Arizona dropped three games all by one run at AT&T Park from May 10-12.
This one wasn't close.
Beltran added an RBI single in the fifth and singled again in the seventh to match his career high with four hits. It was his 20th career four-hit game and first since June 30, 2007, at Philadelphia while with the Mets.
The slugger finally produced the way the Giants hoped he would when they acquired him in a July 28 trade from New York, showing the power stroke that has defined his 14-year big league career. The six-time All-Star recently spent a stint on the disabled list with an injured right hand and wrist.
Ross, one of those castoffs and misfits who shined last September and during an improbable championship run, connected in the seventh. Then, he made a spectacular diving catch on Justin Upton's sharply hit fly to start the eighth. Ross caught the ball in fair territory and slid face-first into the dirt in foul territory.
Ross also snapped an 0-for-16 stretch with his fifth-inning double.
Cain appeared to be in trouble right away but wound up going eight innings, allowing two runs and five hits. After striking out Ryan Roberts to start the game, he allowed Aaron Hill's single, a walk to Upton then Miguel Montero's RBI double. Chris Young drew a free pass one out later to load the bases for Gerardo Parra, but Cain retired him on a fly ball to left.
"We had a good opportunity in the first inning to score two runs but we didn't," Montero said. "We had the opportunity but we couldn't make it happen. Today was a little rough for us."
Keppinger's double off the left-field wall in the third tied the game at 1, then Beltran followed with his 17th home run. Keppinger has eight RBIs in his last nine games.
Beltran hit just his second clout in 21 games since joining the Giants. He came into the game in an 0-for-11 funk and was hitless in his previous three games. He also had been unsuccessful in his last eight at-bats with runners in scoring position and was 2 for his last 20 with chances to drive in runs.
"We had some big hits, the longball, two-out hits," Giants manager Bruce Bochy said. "We've been missing that for a while. Better late than never."
Saunders fell to 0-3 lifetime against the Giants, all the losses this year. He never found a rhythm with a sellout crowd of 40,948 on their feet cheering on a night fog swirled above the outfield in the early innings and wind whipped the ballpark flags right off the bay.
The Giants are the only NL West team Saunders is yet to beat. Hill added a sacrifice fly in the fifth for Arizona's other run.
Pat Burrell was back in the San Francisco lineup and playing left field after he missed 43 games with a strained right foot. He struck out and walked twice before being replaced.
These teams meet for three games at Chase Field in the season's final week. ... Beltran tripled in the first. The homer was No. 297 of his career. He is batting .500 (14 for 28) with a homer, three triples, a double and four RBIs in seven games against Arizona this season. ... Lincecum is 0-1 in two starts vs. the D-backs this season despite a 1.20 ERA. He has allowed two earned runs and seven hits with 17 strikeouts and five walks over 15 innings. The loss came here Aug. 2. ... Kennedy beat Cain on Aug. 1 during his stretch of seven straight winning starts. ... The Giants are 45-9 when scoring four or more runs.