Zach Randolph scored 15 points and Jerryd Bayless had 13 for the Grizzlies, who won in Houston for the first time since April 2006.
|More on Grizzlies-Rockets|
|More NBA coverage|
James Harden scored 30 points, but missed a potential game-tying jumper from near the top of the key just before the buzzer.
Memphis has won seven of eight games, while the Rockets lost for the third time in 11 home games.
Jeremy Lin had 17 points for Houston and sank a 3-pointer with 1:33 left to tie it at 78-all. Gasol split two free throws to put the Grizzlies up by one heading into the final minute.
Mike Conley was fouled by Patrick Beverley and sank another free throw with 33.5 seconds left to make it 80-78.
On Tuesday night, Houston beat Phoenix when Jermaine O'Neal was called for goaltending on Harden's last-second 3-pointer, and everyone in the sellout crowd knew the Rockets would go back to Harden again.
He sidestepped Tony Allen for a clear look at the last shot but missed, and the Grizzlies beat Houston for the third time in four meetings this season.
The Grizzlies' top-ranked scoring defense stifled Houston most of the night. The Rockets, the NBA's highest-scoring team, went 23 of 73 from the field (31.5 percent) and committed 20 turnovers.
Harden sank a 3-pointer with 1:57 left in the opening quarter, but he went 1 for 5 in the quarter and Memphis led 24-15.
Rockets coach Kevin McHale had point guards Lin and Beverley on the floor for the start of the second quarter, and Beverley hit a 3 from the corner. Otherwise, the Rockets' offense continued to sputter, and Darrell Arthur finished another alley-oop, this one fed by Keyon Dooling, for a 32-22 Memphis lead.
McHale had his starters back in for the last four minutes of the half, but Houston didn't reach 30 points until Greg Smith's free throw with 3:05 left. Bayless, back after sitting out two games with a sore right knee, sank a 3-pointer and Tayshaun Prince drove for an easy dunk to put the Grizzlies up 46-30.
Harden just beat the halftime buzzer with a 3-pointer, but Memphis led 49-36 at the break. Houston went 11 for 37 from the field and gave away 10 turnovers in the half.
The Rockets got better shots in the third quarter and chipped away at the deficit. Harden sank two 3-pointers and Omer Asik outmuscled Gasol for a dunk to pull Houston within eight. Memphis missed 10 of its first 16 shots out of halftime to help Houston stay close.
Gasol hit a fadeaway jumper with 7:14 left, ending a 7-minute field-goal drought for Memphis. The Grizzlies' defense picked up again and the Rockets were back to the shaky offense they showed at the beginning. Prince intercepted Harden's bad pass and Conley sank two free throws after a hard foul by Beverley for a 76-68 Memphis lead.
Lin sank a 3-pointer with 3:13 left, Houston's first field goal in six minutes, then found Asik for a dunk to cut the gap to three. After Harden sank two free throws, Randolph hit two with 1:55 to go and Memphis led 78-75.
Allen briefly left after hurting his left hip colliding with Smith in the third quarter. ... Gasol recorded his 100th career double-double. ... Harden has 22 30-point games this season. ... Rockets F Chandler Parsons missed his fourth consecutive game with a strained right calf. McHale expects Parsons to play in two of Houston's final three regular-season games, including the finale against the Lakers.