Randolph made 15 of 19 shots from the field and also had 17 rebounds. The 6-foot-9 burly forward is averaging 23 points and 17 rebounds in three games against Phoenix this year, and 22.3 points and 14.4 boards in his last seven games against the Suns overall.
"Zach is a touch matchup, not only for us," Phoenix coach Alvin Gentry said. "He's good at angles and he has a soft touch. It's tough to defend him."
Mike Conley had 11 points and a career-high 14 assists for the Grizzlies, who picked up their first road win since Nov. 6 at Sacramento. They had dropped their previous six away from home.
Gay sent the game to overtime with a 3-pointer just before the regulation buzzer that tied it at 92. Gay's 22-footer from the left corner was his only 3-point attempt of the game.
"It was well-executed," Memphis coach Lionel Hollins said. "We got the guy we wanted and he hit the shot."
Randolph had the key basket in OT, making a turnaround bank shot to give Memphis a 98-96 lead with 2:30 left. Goran Dragic missed a 3-pointer on the other end and Gay hit two free throws to extend the lead to four.
"Zach was vintage Zach tonight," Gay said. "He played great for us. We all know Zach can rebound and score, but the other things we've been working on with him and when we needed him to set a great screen he did it. That's a winner and that's what we want around here, winners."
Memphis carried a 78-64 lead into the fourth quarter but the Suns stormed back to tie it at 86 on Turkoglu's 3-pointer with 2:48 remaining. Turkoglu added a tiebreaking 3-pointer with 6.2 seconds left.
Conley and Frye each went 1 for 2 from the free-throw line before Gay came up with the big shot.
"We didn't fold, but we've got to learn how to win games," Randolph said. "We have to learn to sustain that lead to be a playoff team that we want to be."
Darrell Arthur finished with 12 points and 10 rebounds for Memphis, which shot 49 percent from the field. The Grizzlies also had 23 assists, compared to 16 for the Suns.
Grant Hill and Hakim Warrick had 10 points apiece for the Suns, who trailed 53-41 at halftime. Phoenix, which was coming off a 106-99 loss at Portland on Tuesday night, went 17 for 27 from the foul line.
"It was a tough loss," Hill said. "It would have been nice to get that win. The fourth quarter was unbelievable. The second unit was awesome, but I'm still in shock at what happened."
The Suns and Grizzlies each had 47 rebounds. ... Memphis went 18 for 22 from the foul line.
The 76ers are trying to acquire the No. 3 overall pick from the Boston Celtics, league sources tell ESPN's Marc Stein and Chad Ford.
Get to know the NBA's next crop of superstars.
Isaiah Thomas says his pitch to free-agent-to-be Kevin Durant would be about the tradition of the Celtics and the great fans in Boston.