The victory gave the Sox their first series win at home since May 24-26 against the Marlins, and their fourth straight victory on Independence Day. It also kept them from falling to a season-worst 16 games under .500.
"I'm not writing this year off," Dunn said. "I don't know what everyone else is saying or thinking, but I'm not writing this year off yet. We're capable of running off some significant wins in a row. Hopefully this is the start of something good."
Not to be lost in the walk-off hoopla was the terrific pitching performance from starter Jose Quintana, who struck out a career-best 11, including eight of the final 13 hitters he retired in succession, and scattered two hits before leaving after the seventh with a 2-0 lead.
In eclipsing his previous career-high eight strikeouts set on July 5 of last year, Quintana became the sixth White Sox pitcher this year to record 10 or more strikeouts in a game.
"You try to prepare yourself the best you can for every outing," Quintana said through translator Lou Hernandez. "In the beginning of the outing, I felt I had very good control and I was going to be able to do some things, and that's what led to me striking out so many batters. But I just try to prepare myself for every outing in that respect."
Quintana was replaced by right-hander Nate Jones, who walked Brian Roberts and surrendered a double to Nate McLouth to begin the eighth. Dunn misplayed a grounder at first, allowing Roberts to score, and a Nick Markakis sacrifice fly tied the game at 2.
It was the second straight game since regular setup man Jesse Crain was placed on the disabled list on Wednesday that the White Sox bullpen surrendered the tying or go-ahead runs. Addison Reed pitched a 1-2-3 ninth and got the win.
"The way Q pitched, and how that inning went down," Dunn said, "it was good any way we could to get that win."
It was the fifth time in Quintana's career that he has thrown at least seven innings of shutout ball and received a no-decision. Dunn went 3-for-4 and is hitting .333 with three doubles, 10 home runs and 26 RBIs over his last 23 games.
"Once he's hitting the ball the other way, he's dangerous," manager Robin Ventura said. "He's dangerous any time he goes up there. But just the quality of the at-bats is great to see."
The two teams combined for four total hits through the first five innings, and the game's first extra-base hit was an Alexei Ramirez double off Orioles starter Zach Britton to lead off the sixth. Alex Rios drove him home on the following at-bat with a ground-ball single up the middle.
Dunn then roped a single to left, scoring Rios, who had advanced on center fielder Adam Jones' throw home on the previous play and Dayan Viciedo's sacrifice fly, giving the Sox a 2-0 lead.
Of Britton's 14 runs allowed this year (spanning five starts), 10 have come in the sixth inning. He pitched into the seventh for the first time this year on Thursday.
"It's just disappointing to lose in general," Hunter said. "I don't think it's any particular way. If you lose, you are going to be disappointed. ... Pat Zach Britton on the butt, say, 'Good job,' and, 'Sorry,' and move on."