The Nationals overcame an early six-run deficit, then took a four-run cushion into the ninth inning before having to sweat out their fourth straight win.
Kansas City scored three times in the ninth and had the tying run on first with just one out before Rafael Soriano came on to put down the rally and claim his 33rd save.
The Royals lost their sixth in a row despite matching Washington with 13 hits.
Kansas City scored six times in the first two innings with three of those runs being driven in by Eric Hosmer on a home run and single.
Washington then erupted for its seven runs on six hits in the fourth. A bases-loaded double by Bruce Harper brought in all three runners before Werth unloaded with his 19th homer.
Tanner Roark (4-0) earned the win by pitching 4 2/3 innings of one-hit relief. Kansas City starter Bruce Chen (5-2) was caught up in the big inning and wound up allowing seven runs on six hits and five walks in 3 2/3.