The Twins took advantage of poor defense by the Tigers in the late innings. Minnesota scored three runs in the eighth, spoiling another fine start by Detroit rookie Robbie Ray.
The Tigers led 3-1 with two outs in the eighth when Josmil Pinto singled to left field off Joba Chamberlain (1-2) with runners on first and second. One run scored on the hit, but the ball skipped past left fielder Rajai Davis for an error that tied the game and allowed Pinto to reach second.
Nunez followed with his single to make it 4-3.
Twins manager Ron Gardenhire was ejected in the fourth for arguing a call near second base.
Ray pitched six scoreless innings in his second big league start and Ian Kinsler homered to put the Tigers up 3-0 in the fifth. The bullpen couldn't hold on, although Detroit's outfield defense didn't help matters.
Minnesota pinch-hitter Danny Santana hit an RBI single in the seventh. Pinto ran through a stop sign and scored from second. He may well have been out at the plate, but right fielder Torii Hunter - apparently expecting Pinto to stop at third - tossed the ball quickly to second instead of throwing home.
Davis' error in the eighth cost Detroit even more.
With a runner on second and one out in the bottom half, Victor Martinez hit a line drive up the middle that hit reliever Casey Fien. The right-hander picked up the ball and threw a one-hopper to first to retire Martinez, then Fein left the game with a bruised right arm.
Perkins came on and got pinch-hitter Nick Castellanos on a flyout with a runner on third.
Ray was acquired in the offseason deal that sent Doug Fister to Washington, and he's contributing to the Tigers far earlier than many expected. With Anibal Sanchez dealing with a finger injury, the 22-year-old Ray has allowed one run in 11 1-3 innings. He allowed four hits Sunday.
Minnesota starter Samuel Deduno gave up three runs and six hits in six innings.
Miguel Cabrera hit a sacrifice fly in the first, and the Tigers made it 2-0 in the fourth on an RBI single by Austin Jackson. Detroit had the bases loaded later that inning when Gardenhire was ejected.
With one out, Andrew Romine hit a grounder toward shortstop, but the Twins had no chance to turn a double play because the ball hit Jackson, who had been on second. Jackson was called out, Martinez was sent back to third and Romine was awarded first, leaving the bases still loaded with two outs.
Gardenhire came out to argue, apparently wanting the umpires to award a double play. Third base ump Joe West, the crew chief, ejected him.
The play didn't cost Minnesota any runs. Davis followed with a groundout to end the inning.
NOTES: It was Gardenhire's first ejection of the year and the 68th of his career in the regular season. ... Detroit plays at Baltimore on Monday night. Rick Porcello (5-1) starts for the Tigers against Bud Norris (2-2). ... The Twins have Monday off before hosting Boston. Ricky Nolasco (2-3) takes the mound for Minnesota on Tuesday night against Felix Doubront (1-3).