Deniz Undav scored twice, including a 94th-minute winner, to earn Germany a 2-1 win over Ivory Coast.