Brazil took an early 10th minute lead through Robinho's cool finish, the pre-tournament favourites were lloking comfortable at halftime with a 1-0 lead.
The Dutch found an equaliser that completely changed the course of the game. Wesley Sneijder whipped in a cross from the right after a quick free-kick and goalkeeper Julio Cesar failed to punch clear, colliding with Felipe Melo and the ball flicked off his team-mate's head and flew into the net.
The winning goal came in the 68th minute after Dirk Kuyt flicked on Robben's corner at the near post and Sneijder headed in, sending the army of Oranje fans at Nelson Mandela Bay Stadium wild.
Brazil found themselves in even deeper trouble when Felipe Melo saw red for stamping on Arjen Robben with 17 minutes to go and, although Dunga's side gave everything in a thrilling finale, they crashed out in the quarter-finals for the second successive tournament.
It is the Netherlands who will go forward to play Uruguay or Ghana in the semi-finals.
ScorersBrazil : Robinho, 10
Netherlands : Felipe Melo (og), 53
Netherlands : Sneijder, 68