The below-par Russian fought off six match points in the final set as she tried to keep alive her hopes of a second Wimbledon title to go with her 2004 triumph, but finally succumbed in a nerve-jangling finale.
Both players had been out of action since Saturday, after bad weather meant their fourth-round clash was postponed Monday, and it was Kerber who was quicker into her stride, leading throughout the first set.
Sharapova found her range to break back at 4-5 but some poor errors allowed the 26-year-old Kerber to win the last three points of the opening set tiebreak.
The Russian hit back to level the match and seemed to be favourite to book a quarter-final place but Kerber, defending for all her worth to keep the more powerful Sharapova at bay, moved into a 5-2 lead in the decider.
Sharapova saved a match point at 2-5 and Kerber's nerve failed her at 5-3 as she served a double-fault on the way to dropping her serve.
The real drama was saved until the end though as Sharapova saved five more match points and looked poised to complete a remarkable comeback.
Kerber would not be denied though and was celebrating when Sharapova fired a backhand long.
The German will have to recover quickly as she faces Canada's Eugenie Bouchard for a place in the semis on Wednesday.