Aaron Ramsey's first half penalty sent Wales on their way to victory against Latvia before Bournemouth winger David Brooks added a second in stoppage time on Monday evening.
The visitors secured their second group D victory in their fourth European Championship qualifier to relieve the pressure on manager Rob Page.
Wales named a strong starting side led by new Tottenham recruit Brennan Johnson, but struggled to break down a resolute Latvia defence in Riga.
They eventually got their breakthrough in the 29th-minute after Harry Wilson was fouled by centre-back Kaspars Dubra.