The victory gave Houston a series win for the first time since taking two of three from the White Sox June 8-10.
Johnson has heated up lately with 10 hits in the last five games after getting just one in the previous five. He's had five RBIs in the last two games after not driving in a run in the previous 11 games.
He and Houston manager Brad Mills attributed his success to some tweaks Johnson made after talking with hitting coach Mike Barnett.
"We talked about being short to the ball and trying to keep my swing from getting long and trying to stay away from being pull-happy," Johnson said. "So those things, staying in the middle of the field, being short, have helped me out a lot."
Along with the homer, Johnson had two singles on Sunday, both of which came with two strikes.
"The swings he's started to put on balls, especially his two strike approach has been real good if you ask me, because a lot of those balls are coming with two strikes," Mills said.
Houston starter J.A. Happ (6-7) got his second consecutive win by allowing four hits and a run in seven innings. He continued a streak of solid pitching by the Astros, whose starters have a combined 1.88 ERA in the last seven games.
"To see the guys continue to throw the ball like they are is definitely outstanding," Mills said. "It really helps out the bullpen down there because they had a lot of use on that road trip."
Johnson's run-scoring single in the fourth tied it at 1 and Carlos Lee put Houston on top with an RBI single in the sixth.
Johnson's two-out, two-run opposite field shot to the stands in right field stretched Houston's lead to 5-1 in the eighth. Martinez's homered to left later in the inning.
The superstitious Johnson was reticent to talk about his success, saying he didn't want to jinx it. But he did admit that things are "coming around" for him.
"I feel like I have a good plan right now," he said. "I feel like I'm just trying to make sure I get my pitch and hit it hard and things are falling in."
Cleveland's Derek Lowe (7-6) gave up eight hits and three runs in 6 2/3 innings to leave him with just one win in his last seven starts.
"It was as bad a pitching month as you can have," said Lowe, who has a 6.44 ERA in five starts in June.
Jose Lopez doubled to start the second inning and moved to third on a groundout by Michael Brantley. He put Cleveland up 1-0 when he scored on a wild pitch by Happ, who then walked Shelley Duncan before a single by Casey Kotchman, but Happ retired the next two batters to limit the damage.
Happ didn't allow another hit until Kotchman led off the fifth with a single. Lowe had a bunt single with one out, but Happ retired the next eight batters he faced before he was replaced for the eighth inning.
The Indians couldn't get much going offensively this weekend. They scored just four runs in the three-game series after piling up 21 runs in a three-game sweep of the Reds in their last series.
"We struggled big time offensively the whole series," Cleveland manager Manny Acta said. "Happ was very good. He had that sneaky fastball and changed speed on us. We weren't able to do anything."
The Astros didn't get a hit until a single by Lee with two outs in the fourth inning. Brian Bogusevic singled on a ball that was deflected by second baseman Jason Kipnis, before an RBI single by Johnson tied it at 1-all.
Jed Lowrie doubled down the right field line with one out in the sixth inning before Lee's bouncing single got by a diving Kipnis to score Lowrie and put Houston on top 2-1.
Johnson and Jason Castro hit consecutive singles to start Houston's seventh. Johnson scored to make it 3-1 when Martinez grounded into a double play. Asdrubal Cabrera had a nifty backhanded flip to second base to get the double play going.
Houston second baseman Jose Altuve strained his right hamstring running trying to beat a throw to first base in the fourth inning. He was replaced by Bixler and is listed as day to day.
Houston starter Bud Norris, on the DL with a sprained left knee, pitched five innings in a rehabilitation assignment for Triple-A Oklahoma City on Saturday night. He allowed two runs and three hits with seven strikeouts. ... Houston left-hander Wandy Rodriguez faces San Diego's Ross Ohlendorf when the Astros and Padres open a four-game series on Monday. ... Josh Tomlin pitches for Cleveland when the Indians open a series against Hiroki Kuroda and the Yankees on Monday.