Germany started well when Thomas Mueller produced a straightforward follow-up finish after Fernando Muslera could only parry a long-range drive from Bastian Schweinsteiger.
Uruguay forced their way back into the game with Edinson Cavani finishing a classy counter-attack after Schweinsteiger was robbed in midfield.
Diego Forlan put Uruguay ahead with an acrobatic volley shortly after half-time, smashing the ball into the wet turf and it speed into the net at chest height at some pace.
But Germany equalised within 5 minutes, with Marcell Jansen leaping above keeper Muslera to nod home a quick reply.
With 8 minutes left, Sami Khedira capitalised on a goalmouth scramble from a Mesut Ozil corner to head home a goal that ensured Germany would end their tournament on a happy note.
Goalscorers1-0 Thomas Mueller, 18
1-1 Edinson Cavani, 28
1-2 Diego Forlan, 51
2-2 Marcell Jansen, 56
3-2 Sami Khedira, 82