It was a remarkable finish from the 14th-placed Knights, who were flogged 50-10 by South Sydney in Cairns last week.
Down 16-10 at halftime, the Knights hit back in the 48th minute when winger Chanel Mata'uitia scored his first NRL try, diving under pressure for a one-handed put down in the corner.
But Waqa put the margin back out to six points in the 51st minute with his third try for 20-14.
In the 66th minute, centre Will Chambers broke the hold of three defenders over the line to touch down and put Melbourne ahead 24-14.
Knights centre Dane Gagai then surged from dummy-half to score in the 71st minute before Waqa powered over for his fourth four-pointer.
It appeared the winning play for Melbourne, who led from the sixth minute when halfback Cooper Cronk put second-rower Kevin Proctor through a gaping hole before Slater backed up on the inside to score under the posts.
The visitors made it 12-0 in the 11th when Waqa snatched at a Tyrone Roberts pass near halfway, juggled it then sprinted clear for an easy try.
Back-rower Chris Houston celebrated his 150th NRL game with a try in the 22nd minute after Uate, making his return from a game in the NSW Cup, beat two defenders to throw an overhead pass.
The hosts cut the deficit to two points four minutes later when Roberts spilled then regathered the ball over the line to score off a Gidley cross-field kick the Storm fumbled.
Gidley missed the conversion, which hit the post to leave the score 12-10.
Waqa pushed the margin back out to six points when he scored in the corner in the 38th minute.
Storm bench forward Tim Glasby was put on report for a high shot on Sione Mata'utia in the 43rd minute.
- AAP