
The win is the seventh in eight games for the Orioles (53-50), who move to five games behind the New York Yankees in the American League East.
Gausman (2-2, 3.97 ERA) gave up two runs on four hits in seven innings of work, striking out six without issuing a walk.
Joseph hit a two-run homer, his eight, off Detroit starter Anibal Sanchez (10-9, 4.77 ERA). Machado added a solo shot in the seventh, his 23rd homer of the season.