Randolph scored 21 of his 27 points in the second half for the Grizzlies, who stopped Dallas’ winning streak at eight games. Randolph also grabbed nine rebounds.
Mike Conley added 17 points and 10 assists for Memphis, which got 16 points and 10 boards from Marc Gasol.
Jason Terry finished with 26 points off the bench for the Mavericks, who also saw a nine-game home winning streak come to an end. Dirk Nowitzki chipped in with 23 points.
Terry’s jumper with 1:09 to play put the Mavericks ahead by three, 101-98. Randolph then made a pair of free throws at the other end to make it a one- point game.
After Shawn Marion missed a runner, Brendan Haywood blocked O.J. Mayo’s jumper. The ball was tipped under the basket to Shane Battier, who put in an easy layup for a 102-101 Memphis lead with 14.3 seconds left.
Dallas put the ball in the hands of Nowitzki, who made a shot from the foul line with 3.1 ticks remaining to give the Mavericks the lead.
But Randolph worked his magic following a timeout. Conley passed the ball to Randolph in the left corner, and he drained a contested 17-foot jumper with 0.3 seconds left for a 104-103 edge.
Terry was way off the mark with a 34-footer as time expired.
Dallas dominated the first half, shooting 51.2 percent from the field to build a 55-38 margin. The Mavericks led by as many as 18 in the half.
But Memphis started its comeback with a 41-point third quarter. Down by 15, 59-44, early in the frame, the Grizzlies went on a 16-4 run to get right back in the game. Randolph capped the burst with a layup to make it 63-60 with 5:41 to go.
The visitors then took the lead late in the period, as Gasol made two free throws to give the Grizzlies a 79-78 lead heading to the fourth. It marked the first time since January 29 that Dallas trailed after three quarters.
Memphis took three of four from Dallas this season…The Mavericks were without Tyson Chandler (sprained right ankle)…Dallas went 10-of-21 from beyond the arc, while the Grizzlies went 3-of-15 from three-point range…Battier and Mayo each had 11 points off the bench…Rodrigue Beaubois had 15 points for Dallas, which shot 50.7 percent from the field.