It ended a pitchers' duel between Mike Pelfrey and Matt Garza, which finished in a stalemate for the right-handers, as they both pitched well but were saddled with no-decisions.
"Normally when you give up two runs, you're going to win the game," Twins manager Ron Gardenhire said. "But Garza threw the living fire out of the ball. We thought Pelfrey was unbelievable, but we couldn't get any hits to knock in any runs."
Left-hander Caleb Thielbar started the ninth for the Twins, but he gave up a one-out double to Alex Rios before intentionally walking Jeff Baker. He was able to get Jurickson Profar to fly out to center for the second out, but the Twins opted to go with right-hander Josh Roenicke to face Craig Gentry.
Roenicke ended up walking Gentry to load the bases to bring up Martin, which caused Gardenhire to bring in the left-handed throwing Duensing. Duensing got ahead of Martin with a 1-2 count before Martin singled up the middle to give the Rangers the victory.
"It's my second walk-off," Martin said. "I was concentrated in that at-bat. I wasn't looking for a homer. I was just protecting my zone, and it worked."
It came on a night when Pelfrey turned in one of his best performances of the year, as he surrendered just one run on six hits over seven innings without issuing a walk. He also tied a season high with seven strikeouts.
"This was probably his best outing, if not for the year, in a long time," Gardenhire said. "He's throwing the ball pretty good right now. He's pounding the zone. I don't know how many changeups he threw, but he moved the ball in and out. His pace was good."
It was an impressive turnaround for Pelfrey, who walked a career-worst six batters in his last start and now has quality starts in three of his last four outings since skipping bullpen sessions in between starts.
"It was good after walking six last time," Pelfrey said. "I told you guys that was pretty embarrassing. I think it was a career-high, so that's not me. So I wanted to go back out there and get ahead and throw strikes."
Garza, who pitched with the Twins from 2006-07, was also solid, throwing seven strong innings. He gave up just one run on three hits and three walks while striking out nine.
The lone run scored against Garza came on the first batter of the game, as Brian Dozier launched a solo blast on the third pitch of the night. It gave Dozier his 15th homer, which set a record for most homers in a season by a Twins second baseman.
"He can juice it," Gardenhire said about Dozier. "He's playing good, swinging good and playing good defense."
The Rangers tied it up in the first on a sacrifice fly from Adrian Beltre after Elvis Andrus and Ian Kinsler laced back-to-back singles with one out. But Andrus left the game with tightness in his back while running to third on Beltre's single and was replaced by Adam Rosales, who scored on Beltre's sacrifice fly.
But that was it for the scoring until Martin's game-winning hit in the ninth. The Twins had a few opportunities to take the lead, but went 0-for-3 with runners in scoring position, including stranding Ryan Doumit and Chris Colabello in the seventh inning.
"Normally if you hold the Rangers like that you feel pretty good about yourself," Gardenhire said. "But unfortunately we lost tonight."