Johnson, who struck out in his first two at-bats, drove a full-count pitch from Ted Lilly (8-10) to the train tracks in left field for his eight homer, erasing a two-run deficit. Hunter Pence singled to extend his hitting streak to 10 games and Carlos Lee walked to set up Johnson's one-out drive.
Bud Norris (7-8) struck out seven in six innings for Houston, which has won three straight.
The Dodgers have dropped six straight and eight of nine to continue to fade from playoff contention.
Andre Ethier hit a two-run homer in the first inning to give Los Angeles the lead. Ethier's shot bounced just above the yellow line on the wall in left-center and scored Jamey Carroll, who reached on an error by Johnson.
But Norris settled down from there, allowing just three hits total and four walks. Gustavo Chacin got two outs in the seventh, Mark Melancon pitched 1 1-3 innings and Brandon Lyon worked a perfect ninth for his 14th save, completing the four-hitter.
Lilly allowed seven hits in six innings.
John Lindsey, who was recalled for Ethier before he got to hit or play in the field on Wednesday night, made his first major league plate appearance Thursday after 15 years in the minors. The 33-year-old hit for Lilly in the seventh inning and was out on a fly ball to center field.
NOTES: Dodgers manager Joe Torre kept some of his regular starters out of the lineup after the team arrived at the hotel in Houston about 6 a.m. after Wednesday night's game in San Diego. ... It had been a year and 139 days since the Dodgers last played in Houston before Thursday night. ... Astros RHP Felipe Paulino, on the 60-day disabled list with a right rotator cuff injury, threw a simulated game. "He threw the ball really well," manager Brad Mills said. "We have to just wait and see how he feels tomorrow and proceed from there."