Whitby remain top of the Northern Premier League but lost their unbeaten home league run as Grantham completed a double over the Blues.
The Lincolnshire outfit started well and rattled the crossbar from Rhys Lewis' 18 yarder after Adam Gell was caught in possession.
At the other end, Dale Hopson released Mikey Roberts but good defending forced him to fire wide. Grantham skipper Stefan Galinski brought a good low parry from Shane Bland point blank after heading down at the far post and Bland smothered the resulting low cross.
Within seconds, Mikey Roberts broke at pace from Kieran Weledji's long ball and was taken out on the edge of the box. Last defender Tom Batchelor got away with a yellow card and Dan McWilliams' free-kick was touched over by Grantham gloveman Kieran Preston.
Lee Shaw was then gifted the game's opening goal after he charged down Bland who cleared against the striker, sending the ball spiralling into the empty net.
Shaw then clipped wide from close range, while Danny Meadows forced Bland to fend away a piledriver and Hopson's edge of the box snapshot brought a good save with his legs from Preston.
Grantham almost made it two in first-half injury time, after Lewis' impressive run down the left resulted in a terrific low cross for Filipe Barcelos to see a shot cleared off the line by Andrew May.
Just as they did in the defeat by the same scoreline, at Grantham, last month, Whitby struggled to break down a stubborn Gingerbreads backline, Roberts brought a parry from Preston after a lovely right-wing ball between centre half and left back from Callum Martin, on the hour.
The visitors won it with a breakaway goal, 16 minutes from time. It was Shaw again who popped up in the six yard box to slide between Bland and his right-hand post.