Masahiro Tanaka threw seven strong innings and outlasted Max Scherzer to help the Yankees earn their seventh straight win, a 6-1 victory over the Nationals in the Bronx on Tuesday night.

What was a pitcher's duel for most of the evening changed in the seventh when New York broke a 1-1 tie with the help of four hits, an error and a walk. A throwing error on an Alex Rodriguez grounder to Ian Desmond allowed the go ahead run to score on a play that should have ended the inning. Mark Teixeira then walked, Brian McCann followed with a two-out, two-RBI single and Carlos Beltran drove in a run with a single, as well.

Stephen Drew accounted for New York's first and last runs with a pair of solo home runs, his eighth and ninth of the season.

Scherzer's final line was eight hits, four runs and seven Ks in the losing effort.

Tanaka, meanwhile, improved to 4-1 on the year and 2-0 since returning from the disabled list. In each of his two starts since, he's gone seven, allowed five or fewer hits and given up just one run in each outing. His only mistake on Tuesday was Bryce Harper's 20th homer of the year, a long liner over the wall in deep left-centerfield.