All group winners automatically qualify for the tournament in Qatar.
The Germans, who were eliminated in the first round of the 2018 World Cup and the last 16 at this year's Euros, had an early chance with a Thomas Muller header.
But, as in their 2-1 home win over Romania on Friday, the Hanis Flick's team lacked precision with their final pass and finishing, creating only a handful of chances in the first half until Werner hit the post with a low drive in stoppage time.
"From the result it was perfect. We got what we wanted, qualified as quickly as possible and we now have five wins in a row," Flick, who succeeded Joachim Low earlier this year, said.
"Again the attitude was right. Compliments to the team. They did not ease off. The first half was a bit wild and we lacked a bit of precision. But we kept at it. We can be satisfied."
Germany, beaten 2-1 by North Macedonia in Duisburg in March, broke the deadlock in the 50th minute when Serge Gnabry split the defence with a superb through ball for Muller and he laid it off for Havertz to tap in.
Forward Werner then scored twice in three minutes, first drilling in from another Muller assist in the 70th and then curling a shot home from 15 metres three minutes later.
"It was difficult at the start but it was good we did not concede a goal," Werner, who has now netted in four of the five matches under Flick.
"We know that if we push and attack over 90 minutes then it is only a matter of time until we score. After the lead it was easier for us."
Substitute Musiala completed the victory seven minutes before the end with his first international goal.