Grimm (7-5) allowed three runs in five-plus innings for his second straight win.
"I guess a win's a win," said the Bristol, Va., native. "I'd just love to be able to go deeper in the game, especially when I'm cruising like that, going at guys."
Pettitte (5-6) settled in after a rocky third but dropped his third start in a row since earning his 250th win. He has struggled since coming off the disabled list June 3 and is 2-6 in his last 10 starts since winning his first three of the season.
"My body is feeling good, my velocity is good, my command is good," Pettitte said. "It will turn. I've been through this before and it's worked out all right. I just want my body to keep feeling good."
The 3-4-5-6 hitters in Texas' lineup combined to go 7-for-20 with three doubles and seven RBIs. Nelson Cruz homered and the Rangers got consecutive two-run doubles from Adrian Beltre and A.J. Pierzynski.
"What was nice was to see the middle of my order come up big," manager Ron Washington said. "We need that. Without those guys doing what they did and what they are capable of doing, it would be a long year. They pulled it out for us tonight."
Texas improved to 6-12 against the Yankees since the start of 2011, both perennial playoff teams this decade.
Lyle Overbay homerd off Grimm in the second inning and Ichiro Suzuki homered off Robbie Ross in the seventh for New York.
Tanner Scheppers worked a perfect eighth. Joe Nathan got three quick outs for his 26th save in 27 tries.