Musiala struck for the second game running midway through the first half, much to the anger of Hungary players who felt a foul should have been awarded in the build-up to the goal.
Gundogan grabbed his side's second on 67 minutes as Germany eased to a second successive win in Group A, making sure they will progress to the knockout phase at least as one of the best third-placed sides.
Julian Nagelsmann's men can wrap up top spot when they play Switzerland in Frankfurt in their final group fixture on Sunday. Hungary are staring at elimination after back-to-back defeats and must beat Scotland if they are to stand any chance of reaching the last 16.