Lewis (5-5) retired the first 16 batters he faced before Aaron Hill singled with one out in the sixth.
The right-hander eventually allowed one run on four hits while walking one and striking out seven, breaking a personal three-game winless streak for the American League West-leading Rangers.
David Murphy went 3-for-5 with a two-run homer while Mitch Moreland and Craig Gentry each added a pair of RBI for Texas, which claimed the opener of a three-game.
Diamondbacks starter Ian Kennedy (5-6) was tagged for six runs on 10 hits before exiting after 5 2/3 innings.
Miguel Montero homered for Arizona, which had won five straight coming into the game.