The Dodgers won their second straight series and improved to 4-1 over the final five games of a nine-game homestand.
Nearly five weeks removed from a broken left collarbone, Greinke allowed one run on five hits in 5 1/3 innings. He struck out four, walked none and made 83 pitches (50 strikes).
"It's pretty amazing what this guy was able to do tonight," Dodgers manager Don Mattingly said. "It's just amazing that he's throwing strikes like that and still uses his pitches."
Greinke showed excellent command of all of his pitches, and was able to mix speeds to keep the Nationals off balance. He resembled the dominant pitcher he was before the injury.
"I thought my stuff was pretty good," said Greinke, 2-0 with a 1.62 ERA in three starts. "My stamina needs to grow a little bit, but that could be next start. It was close this time, but it needs to be a little bit stronger throughout the game. I was feeling pretty drained after five."
The Dodgers provided Greinke with run support in the first inning. Matt Kemp doubled to extend his hitting streak to 14 games, and he scored on a single by Adrian Gonzalez as the Dodgers went ahead, 1-0.
Kemp, who went 2-for-4 to raise his average to .282, appears to be breaking out of the funk he was in to start the season.
"I'm feeling a lot better at the plate," said Kemp, who hit the ball hard to all fields and scored twice.
Facing live pitching for the first time since his injury, Greinke drove in his first run since July with a single to right in the second.
Greinke retired the first five batters he faced until Wilson Ramos doubled in the second. That was the only hard-hit ball by the Nationals until Adam LaRoche took Greinke deep to right-center in the fourth. The first baseman belted a 2-1 pitch for his fourth homer to cut the Dodgers' lead in half.
Greinke walked off the field to a standing ovation when he was removed. It was a welcome sight for the Dodgers on the final night of a homestand that began with four straight losses.
"It was definitely a boost," Kemp said. "To see him go out there and pitch [5 1/3] innings and give us a base hit, that's big for us. He drove in a run and helped himself out. He looked pretty good."
Five Dodgers relievers combined to hold the Nationals scoreless over 3 2/3 innings, but it did not come easy.
With runners on the corners and two out in the sixth, Matt Guerrier got a groundout to end the threat.
Kenley Jansen, who earned the save Tuesday, got himself out a jam in the eighth. The right-hander gave up consecutive singles to lead off the frame, but got two flyouts and a strikeout to escape unharmed.
Carl Crawford provided an insurance run with a sacrifice fly in the bottom of eighth, and Brandon League fired a scoreless inning for the first time this month to earn his ninth save.
After allowing six runs through five innings Monday night, the Dodgers pitching staff held the Nationals to one run over the final 22 innings of the series.
"We had the right guys up there," Washington manager Davey Johnson said. "I don't know if we are trying to do too much instead of just hitting the ball and putting it in play. I don't know, but we'll figure it out."
Greinke was injured almost five weeks ago when Carlos Quentin charged the mound and slammed into him during a benches-clearing melee in San Diego. Greinke had surgery on April 13, with a metal plate and screws inserted into his collarbone to stabilize the fracture. He was expected to miss up to eight weeks, but resumed throwing a week after surgery.
"I felt I was healthy enough to pitch over two weeks ago, but I wasn't sharp enough to pitch," Greinke said. "The collarbone feels pretty good. It's not 100 percent, but it doesn't restrict me at all when I'm pitching."
The Dodgers went 10-19 with Greinke sidelined, but improved to 3-0 with the right-hander on the mound.
"To me, it tells you how talented he is," Mattingly said. "He worked his butt off when he was hurt. He wanted to get back as soon as possible and he wanted to be competitive when he came back and he was."