Danilho Doekhi nodded in the winner at the death against Gladbach to send Union back above Bayern Munich.