Dirk Kuyt scored two goals in three minutes late in the game as the Dutch, pegged back to 3-3 in the 75th minute by Zoltan Gera's second goal, snatched a 5-3 win in Amsterdam.
Two goals in the last 20 minutes, one an own goal from Tadas Kijanskas and one from Juan Mata, gave Spain a 3-1 win on a muddy pitch in Lithuania after the world champions had had Xavi's first-half goal wiped out by Marius Stankevicius.
It was a rare case of big guns having to work hard for the points in a tournament which has so far featured a dull procession of effortless wins by the top sides.
The Dutch have six wins from six games in Group E while Spain have won all five in Group I and both are almost certain to top their groups.
The nine group winners will go straight to Poland and Ukraine in 2012 along with the best runners-up. The other eight second-placed teams play off for four more places.
"Matches like this you won't see often," said Dutch coach Bert van Marwijk after his team's 14th successive win in a qualifying match.
The World Cup finalists, 4-0 winners in Hungary on Friday, looked set for another easy victory when Robin van Persie, who later went off injured, gave them a 13th-minute lead.
But Hungary capitalised on a sloppy Dutch start to the second half as they scored twice within five minutes through Gergely Rudolf and Gera.
Wesley Sneijder levelled just after the hour before a sequence of four goals in eight minutes saw Ruud van Nistelrooy put the Dutch ahead, Gera equalise and Kuyt score twice.
Sweden, chasing second spot in Group E, beat Moldova 2-1 as goals from Mikael Lustig and Sebastian Larsson made up for a Zlatan Ibrahimovic penalty miss just before halftime.
Alexandru Suvorov replied for the visitors as Sweden went level with Hungary on nine points, nine behind the Dutch.
Spain appeared to suffer as much with the Kaunas pitch as their opponents who had scored two goals in their first three outings.
"It's all sand," Xavi said. "At this level in 2011 to have a pitch in this state the truth is sad for football. These are issues for UEFA and the like but they should come here and see it because you can't play football here.
"We got the points which was the objective. We have one foot and a half in the finals and so we're happy."
Czech Republic stayed six points behind Spain in second spot after Milan Baros and Michal Kadlec gave them a predictable 2-0 win over Liechtenstein.
Turkey revived their hopes of finishing second behind unstoppable Germany in Group A with a 2-0 win over fading Austria.
Belgium, 4-1 winners over Azerbaijan, are second with 10 points while Turkey are third with nine, the Germans leading with a perfect record.
Luxembourg briefly looked as if they could cause a major upset when Lars Gerson gave them the lead against Romania but two goals from Adrian Mutu helped the East Europeans recover for a 3-1 win in Group D.
Serbia and Slovenia missed a chance to dent Italy's Group C lead when they drew away, keeping both five points adrift.
Serbia drew 1-1 in Estonia after a blunder by goalkeeper Zeljko Brkic allowed Konstantin Vassiljev to equalise for the hosts in the 84th minute in snowy Tallinn, wiping out Marko Pantelic's opportunist first-half effort.
Slovenia drew 0-0 in Northern Ireland.
Please click to read our informative text prepared pursuant to the Law on the Protection of Personal Data No. 6698 and to get information about the cookies used on our website in accordance with the relevant legislation.
6698 sayılı Kişisel Verilerin Korunması Kanunu uyarınca hazırlanmış aydınlatma metnimizi okumak ve sitemizde ilgili mevzuata uygun olarak kullanılan çerezlerle ilgili bilgi almak için lütfen tıklayınız.