The lone hit off Hamels was a two-out double in the second by Francisco Cervelli that tied it 1-1. The left-hander struck out two, walked one and hit a batter during his 33-pitch outing.
"It's fun anytime games start," Hamels said. "It's a lot better than practices. Getting the hitters in there, getting the game rolling. That's something that's very hard to simulate. It was good."
The Phillies have assembled a starting rotation that is being compared to some of the best in baseball history. Roy Halladay, Cliff Lee, Roy Oswalt and Hamels would be the ace on many staffs. "I'm fortunate," Hamels said. "You never have enough baseball knowledge. We're always trying to learn. You have guys that have success, you'll probably learn a little bit more."
Yankees starter Bartolo Colon gave up one run and two hits in two innings. The right-hander threw 23 of 36 pitches for strikes. New York reliever Joba Chamberlain, bidding for a setup role in front of eighth-inning man Rafael Soriano and closer Mariano Rivera, threw a perfect third inning. He reached 94 mph with his fastball.
"It's a great sign for me," Chamberlain said.
Dane Sardinha put the Phillies ahead 5-4 in the eighth with a two-run bloop single to left.
Mark Teixeira, who was hit on the top of the right big toe by Hamels in the first, hit a fifth-inning RBI triple. The first baseman expects to have a toe bruise, but added he was OK.
"I get hit all the time," he said. "That's part of the game."
Teixeira played the final month last season with a broken right pinky toe, which was caused by a pitched ball.
Colon, out of the major leagues since 2009, is competing with Freddy Garcia, Ivan Nova and Sergio Mitre for one of the final two rotation spots behind CC Sabathia, Phil Hughes and A.J. Burnett.
"I thought it was a good first step," Colon said through an interpreter. "I'm going to continue working hard and see what happens."
The 37-year-old right-hander was released by the Chicago White Sox in September 2009 after going 3-6 with a 4.19 ERA in 12 starts. Colon went 21-8 for the Angels in 2005 and won the AL Cy Young Award, but he is 14-21 since.
The Yankees held a pregame ceremony to honor former team owner George Steinbrenner, who died last July at the age of 80. This marked the Yankees' first spring training game at George Steinbrenner Field since his death.
Steinbrenner's wife, Joan, and the couple's two daughters - Jennifer Steinbrenner Swindal and Jessica Steinbrenner - placed roses on the interlocking N.Y. behind home plate. Steinbrenner's granddaughter, Haley Swindal, sang the national anthem.
"Since his passing last summer, the support and compassion shown to us by countless others has brought us great comfort, and today was another example of it," the Steinbrenner family said in a statement.
Yankees managing general partner Hal Steinbrenner also took part. Co-chairman Hank Steinbrenner, George Steinbrenner's oldest son, missed the event because of an illness.
Notes: Spring training instructors, including Yogi Berra, Rich "Goose" Goosage and David Wells, were introduced before the game. Reggie Jackson, who had back problems over the winter, missed the spring training opener, but he is scheduled to join the team before camp ends. ... Phillies 2B Chase Utley (sore legs) didn't play. ... New York C Russell Martin (knee) is set to DH on Monday. ... Yankees INF Jorge Vazquez hit a two-run homer over the batter's eye in center field during the seventh inning.