Borussia Dortmund moved off the bottom of the Bundesliga as midfielder Ilkay Gundogan's diving header secured only their second league win in 11 matches.