Sebastian Vettel retains a massive 77-point lead in the championship after salvaging a difficult afternoon with a fourth place snatched from Ferrari's Felipe Massa in a late pit stop duel between the two teams.
But Red Bull have lost the performance advantage they enjoyed at the start of the season.
They have won only once in four grands prix and, far more tellingly than that, they have been outpaced in the last two races.
McLaren in general and Hamilton in particular, have taken a bit of flak from certain quarters in the last month or so, but they bounced back with a bang in Germany.
Hamilton drove a stunning lap in qualifying to split the Red Bulls on the grid, and he capped it with what he described as "one of the best races I've ever done".
The 26-year-old has produced so many inspirational drives in his career that it is difficult to say whether this was the best, but it was certainly right up there.
As has so often been the case, Hamilton owed his win partly to his unsurpassed abilities as a racer - Alonso's Ferrari emerged from his second pit stop in front, just ahead of the McLaren, but a trademark brilliant passing move around the outside of the red car at the second corner gave Hamilton the lead.
As Alonso struggled on tyres not quite up to temperature, Hamilton pulled out a 1.7-second lead on that lap and followed it with a succession of three fastest laps in a row to extend his advantage to more than three seconds. From there, it was simply a case of not making a mistake with the timing of the final pit stop.
It has been a turbulent few weeks for Hamilton. After pushing Vettel so close for victory in Spain back in May, the wheels seemed to come off a bit.
A difficult weekend in Monaco culminated in frustration and his ill-advised "Ali G" remarks. A disappointing qualifying session in Canada led to Hamilton seeking out Red Bull team principal Christian Horner for a chat about the future. High tyre wear left him fourth in Valencia, way off the pace of the Red Bulls and Alonso. And McLaren struggled again in Silverstone, hit harder than their rivals by the one-race restriction on the use of exhaust gases to boost downforce.
The effect that had had on Hamilton's optimism was clear on Friday when he said there was "no way" he could compete for pole, but his mood turned full circle on Saturday and he entered the race knowing he could compete for victory.
He grabbed the lead at the start, and although he was passed by Red Bull's Mark Webber following a mistake on lap 12, the Red Bull was not able to get away.
As Webber said, "the alarm bells started to ring then", and that analysis was spot on. Just as he had at the first stops, Webber came into the pits first, aiming to take advantage of the extra grip from fresh tyres. But the second time it did not work out, and the Red Bull was jumped by both Hamilton and Alonso, who then left him behind.
Just how much this win meant to Hamilton was clear in the post-race television interviews, as he tried and failed to fight back tears after he had finished speaking.
With those tears - and that drive - perhaps Hamilton has begun to shed the frustration of the past few weeks, and can now relax into a second half of the season that, on the evidence of the last two or three races, should make fascinating viewing.
In the last two races now, the three top teams have fought out victory - and slowly this season is turning into exactly what it had promised to be before Vettel's amazing start.
It remains to be seen whether McLaren are back for good, or whether they benefited from the unique chilly conditions in Germany.
As far as Ferrari are concerned, though, there is now little doubt that they are a genuine challenge for Red Bull everywhere.
As Alonso pointed out, they have been contesting the lead at the last four races, all of which have been on very different tracks, and he now has a win and two second places from the last three grands prix.
The Hungarian Grand Prix next weekend will be a very telling event. Red Bull totally dominated it last year, but the evidence of the last few weeks suggests it may not be so easy for them this time around.
Ferrari, one suspects, will at least give them a run for their money, having proved in the last couple of races that they have largely solved the aerodynamic weaknesses in their car that blighted the start to their season. McLaren, though, appear still to lack efficiency in the sort of long-duration corners that abound at the Hungaroring, which may make life a bit more difficult for them.
Vettel will go there on the back of a rare off-weekend at the Nurburgring, when he was never comfortable in the car and never looking like getting on terms with Webber.
In the race - as has often been the case when he is not leading from the front - he looked ordinary, unable to find a way past Massa for the last 20 laps of the race and needing his pit crew to do the job for him heading into the last lap.
And so the questions over Vettel's ability when he is back in the pack remain.
The last two races have been an eye-opener for Red Bull - and on Sunday both Webber and Vettel talked about needing more from the car.
In the circumstances, Vettel will be pleased to have salvaged a fourth place, and kept his lead over Webber to more than three clear wins.
With such a huge advantage - Vettel is 82 points ahead of Hamilton and 86 in front of Alonso - it is still unlikely that he will be caught. But at least now he knows he has a real fight on his hands.