Altuve, who was out of the starting lineup last weekend against the Rays after he was struck on the hand by a pitch Thursday in Houston, went 4-for-5, including a two-run double in the eighth inning that brought the Astros within a run of the Nationals, who had led, 6-1.
But the Nationals' bullpen shut the door, as Aaron Barrett retired George Springer to end the eighth and strand Altuve at second base, and closer Rafael Soriano pitched around a one-out walk in the ninth to nail down his 14th save.
"Great job of battling," Astros manager Bo Porter said. "That's a really good bullpen they have over there with [Drew] Storen and [Tyler] Clippard and Soriano, and for us to be able to mount the comeback which we were able to have in the [eighth] inning, I'm really proud of our guys."
The Astros were 5-for-14 with runners in scoring position and stranded 11 on base. They loaded the bases with no outs in the fourth inning against starter Tanner Roark (6-4) but managed only one run, when Matt Dominguez hit a comebacker off the leg of Roark, scoring Altuve.
"You look at the difference in the ballgame, it's their ability to hit with men in scoring position early in the game," Porter said. "We let some opportunities slip away early in the game with men in scoring position."
Altuve's four hits pushed his Major League-leading total to 94. He hit into a double play in the first inning before having hits in his next four at-bats, including two doubles, to raise his batting average to .326.
"Altuve, what more can you say?" Porter said. "This guy, he can hit. It doesn't matter who's out there. He's one of the best hitters in baseball."
Keuchel said nothing surprised him when it came to Altuve.
"He's a legit All-Star, and he's our MVP," Keuchel said. "With him missing a few days and coming back, I didn't expect anything less than a couple of hits. That's just what he does. There's nothing that surprises me anymore about that guy."
Keuchel has built a pretty good All-Star resume himself and entered Tuesday having won six of his previous seven decisions. He needed 105 pitches to throw five innings on a muggy and hot night, marking his shortest start since he went five innings on April 5.
"We got some good pitches to hit," Nats outfielder Ryan Zimmerman said. "[Keuchel]'s a good pitcher. You've got to make him get the ball up. He's got a lot of movement. He's been really good this year. We did a good job of getting some pitches we could drive with runners in scoring position. We got out to an early lead."
Keuchel said he had to change his uniform three or four times because of sweat.
"It just looked like he never really got in the groove," Porter said. "He left a couple of pitches up and out over the plate to a couple of really good hitters, and they made us pay. It was a high pitch count through five innings for him. He normally attacks the zone a little bit better. He'll be fine."
Keuchel got Nationals leadoff hitter Denard Span to pound a ball into the plate to start the game, but it bounced so high into the air that Keuchel didn't have enough time to field the ball cleanly. Anthony Rendon (2-for-4) followed with an RBI double and later scored in the inning to make it 2-0.
"That was definitely tough because he's so fast," Keuchel said. "He beat that thing into the plate, and I was trying to position myself to where I could grab it barehanded and flip it over with my wrist, and I didn't make the play. Obviously, Rendon hit a good changeup. Other than that, I was battling and trying to find my stuff all night. I felt fortunate to get through five, especially with the way I was pitching and that lineup and the way they were swinging the bat."
Trailing, 6-1, in the eighth, the Astros scored four runs against Clippard on run-scoring singles by Jonathan Villar and Dexter Fowler and a two-run double by Altuve, who did everything he could to keep the Astros from losing consecutive games for the first time since May 31-June 1.