"Going on contact is a chance you take, but fortunately, I was able to get under the tag," Stubbs said.
With runners on second and third and one out, Kipnis sent a hard grounder to the right side. First baseman Adam LaRoche made a diving backhanded stop and fired to catcher Kurt Suzuki, but Stubbs beat the throw with a slide.
Suzuki, who perhaps had the best view of the winning play, gave Stubbs all the credit.
"He beat the throw. It's as simple as that," Suzuki said. "Stubbs is probably one of the fastest guys in the league, you know, and he just beat the throw."
Cleveland's speed, which also featured a perfect hit-and-run play earlier in the inning, played a big part in the rally as the Indians got back to .500 (33-33).
"You have to respect the speed," Indians manager Terry Francona said. "It was a heck of a play by LaRoche, but fortunately, Stubbs went on contact, and his speed beat the throw."
Stubbs' one-out single off Fernando Abad (0-1) started the rally. As Stubbs broke off first, Michael Bourn punched a ground ball through the hole that opened when Steve Lombardozzi went to cover second base. Stubbs advanced to third before Bourn stole second.
Joe Smith (3-0) retired the side in order in the ninth for the Indians. Cleveland has won three in a row since breaking an eight-game losing streak.
"Losing eight or nine in a row is not the character of this team," Stubbs said. "We just needed a few breaks to go our way to turn things around."
Masterson's bases-loaded wild pitch in the third inning gave the Nationals their run. Gonzalez gave up a two-out homer to Ryan Raburn in the fourth.
The Indians loaded the bases in the sixth and eighth innings but failed to score.
Masterson, who held Washington to two hits, struck out 10 and walked four. He was removed from the game after throwing 113 pitches. The Indians managed only three hits off Gonzalez, who struck out eight and walked four. Three of the walks came with two outs in the sixth, but the left-hander retired Mark Reynolds on a popup to keep the game tied.
Gonzalez, who threw a season-high 127 pitches, is 5-0 with a 0.81 ERA in six career starts against the Indians. He is 4-0 with a 0.82 ERA in five career starts in Cleveland.
"(Gonzalez) was good, so was Masty," Francona said. "We saw (seven) pretty good innings of good pitching both ways."
Masterson remained dominant at Progressive Field. The right-hander is 5-1 with a 2.23 ERA in eight home starts this season.
"He's a great pitcher," Masterson said of Gonzalez. "He's their workhorse. Our guys kept saying, 'Wait him out, wait him out.' And we finally got him out of the game."
Raburn's two-out homer to right tied it in the fourth. Raburn, moved to the cleanup spot by Francona, is 7-for-13 with three home runs against Gonzalez.
Ian Desmond was 0-for-3 with a walk, ending his 15-game hitting streak.
The Indians were coming off a road trip in which they dropped the first seven games before winning the last two in Texas. Cleveland broke an eight-game losing streak on Tuesday.
Francona said RHP Chris Perez (shoulder tendinitis) will "more likely than not" begin a minor league rehab assignment Sunday. Perez, a two-time All-Star, threw a bullpen session Friday. The Indians closer hasn't pitched in a game since May 26. Perez and his wife pleaded not guilty Monday to misdemeanor possession charges after marijuana was mailed to their home in their dog's name. ... RHP Stephen Strasburg (strained right lat) is scheduled to come off the disabled list on Sunday to start against the Indians. ... Nationals manager Davey Johnson said OF Bryce Harper (left knee) might resume baseball activities next week. Harper was given a cortisone injection Monday and was told to rest the knee for a week. ... Francona said RHP Zach McAllister (sprained middle finger) might start playing catch in a few days. ... RHP Jordan Zimmerman (9-3) will start for Washington against LHP Scott Kazmir (3-4) on Saturday night.