Hardy, in an 0-for-11 slide, connected off Tim Worrell (0-2), making his second appearance since Arizona acquired him from Philadelphia last Thursday. It was just the third homer in 216 at-bats this year for Hardy, his second in six days.
"He left the ball up and I took a good swing," Hardy said. "Just to get Benny a win there, it was good. It was good timing."
Sheets (6-7) allowed two runs and seven hits in seven innings with seven strikeouts and three walks. He came in with a no-decision and a loss since beating Atlanta on July 9.
"Any win is huge right now," Sheets said. "We're fighting for .500 and actually, I'd say we're still in a wild-card race here. It's late July and say what you want, seven games out ain't totally out of it."
Yost almost lifted Sheets in the seventh, when the score was tied at 2-2 and Arizona had runners at second and third with two outs.
Yost went to the mound not knowing what to do, but decided to let Sheets pitch to Shawn Green. The right-hander managed to get out of the jam by getting Green to ground out to first base.
"He was in a little bit of trouble all night," Yost said. "The thing I like about Ben, when it gets tough out there, he gets tough."
Diamondbacks starter Mike Gosling gave up two runs and six hits in six innings.
"I just tried to go out and stay aggressive and see what happened because a couple of runs really shouldn't have killed us," said Gosling, born in Madison, Wis.
"You know, he really knuckled down nicely," Arizona manager Bob Melvin said. "He didn't get off to a hot start, but Gosling really settled in."
- Arizona 3B Troy Glaus was taken out of the starting lineup because of back spasms.
- Milwaukee had been the only NL team Arizona had not faced this season. The Diamondbacks began a stretch of 10 consecutive games against NL Central opponents.
- Milwaukee reliever Matt Wise's wife gave birth to a baby girl Monday morning.
- The Brewers play 12 of their next 18 games at home.