A relatively cagey opening stanza ended goalless with all to play for after the break. Sterling broke the deadlock for Gareth Southgate's men with a tap-in from Luke Shaw's cross in the 75th minute.
Thomas Muller then had the chance to equalize after racing behind England's defense. However, he dragged his effort wide on target despite only having Pickford to beat in a shocking miss.
The hosts soon made their rivals pay for it with a second goal. Harry Kane headed low from Jack Grealish's inch-perfect cross in the 86th minute to end the tie as a contest.
Germany made their earliest exit from the competition since going out in the group stages of the 2004 edition. Meanwhile, England moved into the last-8 where they will face either Sweden or Ukraine on Saturday.
Here are the player ratings:
England Player Ratings
Jordan Pickford - 8/10
Pickford's impressive tournament continued with another big performance. He produced a confident save to deny Serge Gnabry before tipping over Havertz's shot over the bar in the second half. A well-deserved clean sheet.
Kyle Walker - 7/10
A solid display from Walker, who was impressive in the back three once again. He played a crucial role in keeping Timo Werner in check while constantly reminding fans of his aerial strengths (seven duels won).
John Stones - 7.5/10
He was the central piece of England's back-three puzzle and read the game brilliantly, making three clearances. Stones was key to impeding Germany on the counter too.
Harry Maguire - 7.5/10
The Manchester United star was influential at both ends of the field. He marshaled the backline with elan, making four clearances and one block and tackle each while testing Germany at the other end with a shot on target.
Kieran Trippier - 7/10
He struggled early on but eventually started getting forward and provided an outlet for England on the wings.
Kalvin Phillips - 7/10
England's star of the Euros so far, Phillips had another good match. He looked to stop Germany in their tracks by jumping into tackles. He got more on the offensive as the match wore on.
Declan Rice - 7/10
He was in and out for some parts but Rice's passing was excellent. He also completed one out four attempted tackles.
Luke Shaw - 7.5/10
Shaw grew into the match over the course of 90 minutes and eventually provided the assist for Sterling's goal.
Bukayo Saka - 6.5/10
Saka looked lively early on with his direct runs, giving Germany plenty to think about. However, he faded as the game went on.
Harry Kane - 7/10
Until the goal, Kane was having another tough outing and had a minimal impact. However, he sprung out of nowhere to head home Grealish's cross and seal the tie for England.
Raheem Sterling - 8/10
Sterling has been England's most dangerous player at the Euros and kept his reputation intact with another goal, his third of the campaign. Slowly but steadily, he's closing in on the race for the Golden Boot.
Jack Grealish - 8/10
An excellent cameo from Grealish, who was involved in both of England's goals, including providing the assist for Kane.
Jordan Henderson - N/A
The match was done and dusted by the time he came on but he managed to make two clearances before full-time.