Pettitte needed little other help in pitching eight sharp innings.
Playing smartly, and perhaps with a sense of urgency, the third-place Yankees avoided falling 9½ games behind Tampa Bay in the AL East. The Rays, with the best record in majors, lost two in row for the first time since June 10-11.
Rays manager Joe Maddon noted the increased attention on this two-game set created "an October feel." He said his team would merely treat it as another series - the Yankees, in their 90th game this season, saw it as chance to make up ground.
Pettitte (10-6) returned to form, giving up only four hits and walking none. He was focused from the start, often standing with his glove in front of his face, even while Tampa Bay hitters stepped out of the batter's box.
Pettitte was hit hard by Boston in his last outing and called that performance "horrible" and "terrible." This time, the Rays barely had a chance as Pettitte improved to 15-4 lifetime against them.
When Tampa Bay had a late glimmer of hope, Jeter extinguished it.
Down 2-0, Tampa Bay put runners at the corners with two outs in the seventh. Willy Aybar hit a grounder in the hole that Jeter tracked down, and the All-Star shortstop made a jump toss from several steps onto the outfield grass that forced out Dioner Navarro at second base.
Pettitte wildly waved his left fist in celebration, and several of Jeter's teammates waited to salute their captain near the pitcher's mound. The crowd broke into a chant for Jeter, and cheered him again when he singled and slid home on Bobby Abreu's double in a three-run eighth.
Reliever Edwar Ramirez pitched a hitless ninth for New York.
Kazmir (7-4), who will be back at Yankee Stadium next Tuesday for the All-Star game, started in impressive fashion. He struck out Jeter and Alex Rodriguez while fanning seven of the first 10 batters.
Jeter came up with runners on second and third with two outs in the third, and hit a drive to right-center field for a 2-0 lead.
Abreu followed with a single, and center fielder B.J. Upton's strong throw cut down Jeter at the plate.
Kazmir struck out nine. He has won just one of his last six starts.
Melky Cabrera, who struck out three times against Kazmir, hit a solo home run in the eighth off Gary Glover and Robinson Cano had an RBI single.