Pettitte (10-7) won his fourth straight start in a game that was delayed by rain for 75 minutes prior to the first pitch.
Jason Giambi hit two solo homers to help the Yankees end a three-game losing streak. Bobby Abreu and Andy Phillips each had three hits, as the Yankees moved within five games of division-leading Boston in the American League East.
Nate Robertson (7-10) suffered the loss, surrendering five runs on 10 hits in six innings.
Detroit slipped into second place in the American League Central, a half game behind Cleveland.
Giambi's first homer came as he led off the fourth, giving the Yankees a 3-1 lead. He added a long shot to right in the eighth.
Notable deaths of 2014 [PHOTOS]