Werner scored twice after Leroy Sane had cancelled out a surprise 12th minute lead for the visitors, who had four players, including top striker Andriy Yarmolenko, ruled out after testing positive for COVID-19 on the eve of the game.
The Germans, in the midst of an overhaul following their 2018 World Cup first round exit, are now top of Group A4 on nine points, one ahead of Spain who they visit on Tuesday. The top team qualify for the final four stage of the competition.
Ukraine, who hit the woodwork three times, are third on six points, with Switzerland bottom on three after a 1-1 draw with visitors Spain.
“We won a match against a good Ukrainian team and overall we can be satisfied,” coach Joachim Loew said. “We wanted also to warm up as a team and I think we did that to a certain extent".