ST. PETERSBURG, Fla. -- Alex Cobb felt like the game was in good hands when he got pulled two outs from a potential shutout.
"He can get on that kind of a roll," Rays manager Joe Maddon said. "When he has his fastball command going, which he had all night, everything else plays off of that."
Cobb (3-1) gave up only two hits through the eighth -- Eduardo Nunez's second-inning single and an infield single by Jayson Nix in the sixth. The right-hander, who struck out seven and walked one, was replaced by Fernando Rodney after giving up a one-out single in the ninth to Brett Gardner.
"I was pretty tired," Cobb said. "Early in the year, close game. Power guys coming up. You've got to get the win, and Rodney obviously shuts the door pretty well."
Zobrist put the Rays up 2-0 on a two-out, two-run double off Andy Pettitte (3-1) in the fifth.
Sean Rodriguez homered for Tampa Bay, which has won 13 of its last 16 home games against the Yankees dating to July 2011. The Rays have thrown five shutouts this season.
Pettitte came up short in his bid to win his first four starts of the season for the first time, giving up three runs and seven hits in six innings. The 40-year old struck out 10, giving him 15 career double-digit strikeout games, and walked one.
Jose Molina was hit in the foot by Pettitte to open the fifth. The catcher advanced to third after Yankees right fielder Brennan Boesch was charged with an error for letting Kelly Johnson's ground single go under his glove. Johnson reached second on the miscue.
"It wasn't over the middle of the plate, it just wasn't a great sequence for me," Pettitte said. "It wasn't a terrible pitch, but obviously it wasn't the right pitch at that time."
Waiting in the on-deck circle when Zobrist got his hit was Tampa Bay slugger Evan Longoria, who was 2 for 20, including two hitless at-bats earlier Wednesday, with 11 strikeouts against Pettitte. Longoria hit an inning-ending grounder to third.
"I'm just trying to get him out," Pettitte said of pitching to Zobrist. "I have no idea what my numbers are on him. I feel like everybody's hitting .300 off me, to tell you the truth, so I'm just trying to make pitches."
Tampa Bay went ahead 3-0 on a solo homer in the sixth by Rodriguez.
Maddon concluded his homestand-long effort to keep his team loose Wednesday by having a pair of penguins, Cliff and Shelly, in the clubhouse before batting practice.
"It's a continuation of our attempt to get our players to chill out a bit," Maddon said.
Maddon featured a cockatoo, which he had in clubhouse and later on his shoulder as he held his pregame media session on Tuesday. Last weekend he had a DJ play music in the clubhouse and a magician do card tricks.
The Rays went 5-1 on the homestand after losing seven of nine on a road trip.
"It was a tough, tough road trip," Cobb said. "It was becoming not fun to be in the clubhouse. We definitely made up for that this homestand, which was also fun."
Yankees INF Kevin Youkilis (lower back tightness) missed his fourth straight game. Manager Joe Girardi hasn't completely ruled out Youkilis from playing Thursday. ... Girardi said OF Curtis Granderson (broken right forearm) took 15 swings of batting practice for the first time in a cage at the team's complex in nearby Tampa. He might take on-field BP this weekend. ... Rays SS Yunel Escobar left with right hamstring tightness. ... MLB announced a scoring change from an Apr 20 game at Toronto that changes Youkilis' two-run single in the fifth to an error. ... New York SS Derek Jeter, who found out last Thursday that he fractured his ankle for the second time in six months, will address the injury with reporters Thursday at Yankee Stadium. ... Longoria finished 0 for 4, which stopped his streak of reaching base safely in 34 straight games dating back to last season.