"A healthy and productive Carlos Gomez will go a long way," Astros manager A.J. Hinch said. "It was nice to see him contribute.
"I love that he can get on the plane and feel like he did something very positive for his team to help us win."
After sweeping the A's in three games, the Astros have won eight of their last nine games and are 21-13 since May 1. They now head to Arlington for a four-game series with the division-leading Rangers.
"The last couple of weeks the team is playing really good, and you can take more time to relax and have more fun, because when you see your team is performing like they are supposed to, it's a good sign," Gomez said. "My job is to keep a good attitude and work and everything will be fine."
Gomez is hitting .191 with six RBIs this season.
His homer off Sonny Gray led off the bottom of the fifth inning and traveled an estimated 388 feet to left field, cutting the A's lead to 2-1. It was Gomez's first homer in the Major Leagues since Sept. 11 at the Angels, ending a 39-game homerless streak (137 at-bats). Gomez also homered in a recent rehab stint while playing for Double-A Corpus Christi.
"I have to keep it up," Gomez said. "Sooner or later it had to pay off. I have to keep the big league attitude and work hard every day."
Gomez also doubled in the eighth inning on a hustle play and later came around to score. The two hits marked his first game with multiple hits since May 3.
"I think that's going to get him going," Astros second baseman Jose Altuve said. "He got some confidence today.
"He looks happy. I know the kind of player he is, and he's going to be really good. If we keep playing like this, it's going to be fun."
Richard Dean is a contributor to MLB.com based in Houston.