Rudy Law walked on four straight pitches with the bases loaded and two out in the eighth inning in Detroit as Chicago rallied from a four-run deficit.
It was Chicago's fourth victory in five games while Detroit lost for the sixth time in its last nine.
Chicago, which trailed, 4-0, entering the seventh, got three runs in the seventh only to fall behind, 5-3, when Lynn Jones singled in a run in the bottom of the inning.
However, Aurelio Lopez (7-5), pitching despite a swollen right hand, couldn't hold the lead.
Lopez entered the game in the seventh after starter Larry Pashnick was touched for Greg Walker's eighth home run with one out and promptly walked Vance Law and Scott Fletcher. Lopez then gave up an RBI double to Julio Cruz and a sacrifice fly to Rudy Law before getting the side out.
Harold Baines singled, Greg Luzinski walked and Tom Paciorek singled to load the bases in the top of the eighth before Lopez struck out Walker on three pitches for the first out. Pinch hitter Jerry Hairston hit a sacrifice fly to cut the lead to a run and Fletcher tied it, 5-5, with a looping single over second. Cruz walked on a 3-1 pitch to load the bases and Rudy Law took four balls to force in the winning run.
Dennis Lamp went the last 2 2/3 innings to raise his record to 6-7. Starter Rich Dotson did not allow a hit until Rick Leach doubled after Wayne Krenchicki walked with one out in the fifth. Both scored on a single by Lou Whitaker and Lance Parrish's sacrifice fly gave the Tigers a 3-0 lead.