"I've never seen anything like it," teammate Ryan Theriot said. "He hits the ball hard, he's getting a hit. He doesn't hit the ball hard, he's getting a hit. It's awesome. It couldn't happen to a better guy."
Posey drove in Cabrera with an RBI double in the sixth inning to tie the game, and followed Cabrera's single in the eighth with a sacrifice fly that scored Theriot to make it 2-1 and help the Giants win for the 12th time in 18 games.
Cabrera finished with three hits to pass Mays for the most ever in May by a San Francisco player and the second most in any month -- one shy of the record set by Randy Winn in September 2005. The Giants have one game left this month.
"I'm very happy I was able to equal a record of Willie Mays and maybe one day be a Willie Mays myself," Cabrera said through an interpreter.
Theriot started the winning rally by drawing a leadoff walk from Bryan Shaw (1-3), who had not allowed an earned run in his first 10 road outings of the season.
Cabrera followed with a single to right that sent Theriot to third, and Posey hit a sacrifice fly to deep right to give the Giants the lead. San Francisco added an insurance run on Joaquin Arias' forceout.
Ryan Vogelsong allowed one run in seven innings but got a no-decision for San Francisco. Clay Hensley (2-3) pitched a perfect eighth for the win, and Santiago Casilla got three outs for his 14th save in 15 chances.
Cabrera, acquired in an offseason deal from Kansas City for lefty Jonathan Sanchez, leads the majors with 77 hits and 25 multihit contests just 50 games into the season.
"He reminds me of Tony Gwynn," said manager Bruce Bochy, Gwynn's former skipper in San Diego. "That's the type of hitter he is. He takes what they give him. He doesn't try to do too much up there. He has a calmness. He doesn't panic even with two strikes. He's just a great hitter."
Cabrera scored the Giants' first run after reaching on a swinging bunt with one out in the sixth against Joe Saunders.
"He's in a different dimension right now," Saunders said. "You just keep making your pitches and hopefully he hits it at somebody."
He scored on Posey's double but the Giants couldn't get any more despite loading the bases with one out. Brad Ziegler relieved and got Arias to hit into a 1-2-3 double play to keep the score tied at 1.
They missed a chance to expand the lead after loading the bases with one out in the fourth. Vogelsong recovered to get Bell on a foul popup and John McDonald on an inning-ending groundout.
The Giants failed to capitalize on their bases-loaded chance in the bottom half as Saunders struck out Arias to strand three runners.
Vogelsong escaped a second-and-third, no-out jam in the sixth by getting Paul Goldschmidt and Bell to ground out and then striking out Saunders after an intentional walk loaded the bases. Vogelsong allowed one run and six hits in seven innings, striking out eight.
"Look, we had our opportunities to beat him and we let it go," manager Kirk Gibson said. "It's as simple as that. Not to take anything away from him, but we're much better than this."
The Giants have no homers in their past eight home games and a major league-low six in 24 home games this season. ... Arizona SS Willie Bloomquist was scratched from the original lineup as a precaution because of soreness in his hamstrings. McDonald took his place in the field, and Aaron Hill moved up to leadoff. ... Giants 3B Pablo Sandoval (broken left hamate bone) felt good after 30 swings of BP left-handed and fielding grounders. He does not know when he'll be able to start hitting right-handed again. ... San Francisco's Tim Lincecum (2-5) pitches against Ian Kennedy (3-5) for the fourth time the past two seasons in the series finale Wednesday, with the Diamondbacks winning the past two meetings.
Pittsburgh Pirates designate slumping veteran infielder Todd Frazier for assignment
Todd Frazier was designated for assignment by the Pirates on Monday to make room for Ben Gamel on the roster.
Fantasy baseball forecaster for Week 6: May 10-16
Set your lineups for the week ahead in fantasy baseball with our forecaster preview, which features pitcher rankings, two-start pitchers, hitter ratings, schedule observations and more.
Fantasy baseball forecaster: Team hitting ratings
Stay ahead of the game and optimize your fantasy baseball hitters with our forecaster, which provides a rolling 10-day outlook of every team's hitting matchups as well as the potential for stolen bases.
Fantasy baseball forecaster: Pitcher projections for the next 10 days
Keep up to date on who is pitching -- and how well they're expected to do -- with our forecaster, which provides a rolling 10-day outlook of every team's probable starting pitchers with game score projections.
Tim Tebow's back: Notable comebacks across sports
Tim Tebow is expected to sign with the Jacksonville Jaguars, which got us thinking ... what other sports comebacks can compare?
New York Mets ace Jacob deGrom headed to IL with tightness in right side
The Mets will place Jacob deGrom on the injured list with tightness in his right side, a move that will keep the ace from taking the mound until May 20 at the earliest.