With the Orioles trailing 3-2 in the last of the sixth, Davis took a Lucas Harrell 3-1 pitch out to left field for the 4-3 lead. It scored Nick Markakis, who led off the inning by drawing the fifth walk off the Houston right-hander.
For Davis, it ended a 10-game homerless streak, his longest of the year. He didn't have an extra-base hit or RBI over his previous six games. It was No. 38 on the season and his first since the last game before the All-Star break.
J.J. Hardy's two-run single in the fourth pulled the O's within 3-2. Hardy, who had been 3-for-22 over his previous six games, now has 60 RBIs.
While not a big display of offense - they had just three hits on the night - the O's will take it after scoring 15 runs total in losing five of the previous six games. That is the fewest hits in any O's win on the year.
Houston put together a few soft singles to produce a three-run rally against Wei-Yin Chen in the third to get the lead.
But Chen didn't allow a run in any other inning and he went 7 1/3 frames, throwing a career-high 119 pitches to get the win. Chen allowed seven hits and three runs to improve to 6-3 with an ERA of 2.87.
In four starts since returning from the disabled list, he is 3-0 with an ERA of 2.57. This was the Orioles' 12th quality start in the last 16 games.
Jim Johnson pitched the ninth to record his 36th save.
The Astros are now 0-7 all-time at Camden Yards. As a National League team, Houston got swept in three-game sets in Baltimore in June 2005 and June 2008.