Ginter also assisted Toni Kroos to add the third.
Germany goalkeeper Manuel Neuer saved a penalty from Igor Stasevich in the 75th minute with Kroos completing the rout with a fourth goal.
In Group C, Germany, who are top of the pile, were aided by the Netherlands who held Northern Ireland 0-0 away to ensure the Dutch and Germans qualified with one match to spare.
Germany have 18 points - from six draws and one defeat - while the Dutch have 16 and Northern Ireland 14.