Christopher Ruhr deflected the ball from close range in the dying moments as Germany earned a crucial win in a Pool B match that India deserved a point.
Niklas Wellen scored in the 18th minute to give the two-time defending champions the lead before Rupinder Pal Singh (23rd) brought India level with his third goal in two matches.