The Liverpool forward opened the scoring in the encounter in Gelsenkirchen with a brilliant header in the 54th minute.
Juan Cuadrado then converted a penalty to double his nation's lead prior to Diaz being withdrawn four minutes before the end.
Meanwhile, Andy Robertson captained Scotland to their fourth consecutive win in Euro 2024 qualifying when they defeated Georgia 2-0 at Hampden Park.
The Group A contest was suspended after seven minutes, with the hosts 1-0 up, due to torrential rain and then resumed following a delay of more than 90 minutes.
Over in Group J, Diogo Jota was a late substitute for Portugal as they beat Iceland 1-0 to maintain their perfect record.