Mayo, who served in a reserve role for the third straight game, shot 8-of-14, including 2-of-5 outside the arc. Memphis has won a season-high three straight, all with Mayo coming off the bench.
"He makes shots," Memphis coach Lionel Hollins said. "That's what he does. He's a shot-maker. He came out aggressive and made them."
Mayo said he has been taking extra shots to break out of a shooting slump and still seems to be adjusting to his new role. But in each of the three games, the Memphis reserves have set a season high for bench scoring. Against the Warriors, the Memphis reserves outscored the Warriors' bench 45-24.
Mayo indicated he is becoming more comfortable, even offering a nickname for the second unit.
"In practice we do a good job now of pushing the first team, understanding we are the second team, but we ain't no slouches," Mayo said. "We're coming into work every day. They kind of call us the Goon Squad.
"We're coming in and working hard every day, and if Coach looks down the line to one of the guys on the second team, he's not afraid to put us in because we've already prepared ourselves in practice."
Golden State center Andris Biedrins had season highs of 28 points and 21 rebounds. Stephen Curry added 26 points, while Monta Ellis added 23 points and eight assists for the Warriors, who lost their fifth straight and seventh in their past eight.
Curry's two free throws with 11.6 seconds left pulled the Warriors within 112-111. But Gay and Mayo both hit a pair in the final 11 seconds to seal the victory. Dorell Wright's 3-point attempt could have tied the game at 114 with about 4 seconds left, but it was off the mark.
"It didn't go down. You can't be mad at it," Ellis said. "That shot didn't cost us the game. We have to move on, and move forward to the next [game]."
Jeff Adrien had 12 points off the Golden State bench.
The Warriors played their eighth game without forward David Lee, who is still recovering from an infected left elbow. Lee will meet the team in Minnesota on Saturday night when the Warriors face the Timberwolves.
That was a major difference for the Warriors, especially inside.
"You take Zach Randolph off [the Grizzlies] for a long period of time, and that is kind of how Lee is for us," Warriors coach Keith Smart said.
Biedrins worked hard inside all night to provide an offensive punch and a 44-33 Golden State advantage on the boards. But it wasn't enough, as Memphis was able to keep the Warriors at bay down the stretch.
"We had a real good opportunity to win this game, and we just had a couple of mental mistakes that we shouldn't do," Biedrins said.
Memphis made its first five shots from the field and missed only two of the initial 11 to build an early 13-point lead. But the Warriors survived the opening Memphis flurry, and Golden State's guards got untracked from outside, hitting three of their first four shots from beyond the arc. That helped erase the Memphis lead.
Biedrins already had surpassed his season high in points midway through the second quarter, and had 14 points and 11 rebounds at intermission.
Ellis led Golden State with 16 in the half, while Curry added 13, the two guards combining to hit five of seven shots from 3-point range. But Memphis got a burst from Mayo, who hit five of his first six shots in the second quarter and scored 11 points as Memphis took a 63-53 lead at the break.
Biedrins scored 10 points in the third, but Memphis still carried an 87-82 lead into the fourth.
The Warriors still had one more rally, and almost overtook Memphis.
"I thought we were right there," Smart said. "We came back in this game three times. We had to claw our way back in the game to make it a game three times. With the effort [the Warriors] are giving, they are playing extremely hard all the way through the game, so you can't fault the effort."
Hubie Brown, who coached the Grizzlies from 2002 to '04 and led them to their first playoff appearance while winning coach of the year honors in the final season, received a standing ovation while calling the game for ESPN2. ... There were no further updates on the status of Memphis C Hamed Haddadi, who was arrested early Thursday on a charge of domestic assault after a fight with his girlfriend. Haddadi was inactive for the game as he was for the previous 10 games, but he was on the Memphis bench in street clothes. Ellis lives in the Eads community east of Memphis and had his teammates out for Thanksgiving dinner. Ellis bought the house, once owned by the late Lorenzen Wright, last spring, a couple of months before the former center's death. ...The Warriors are now 1-7 with Lee out. Biedrins' previous high-point performance was 10 on Nov. 10 against the Knicks.