Petit struck out four and didn't walk a batter. Cesar Valdez gave up a hit in three scoreless innings in relief of the Arizona starter.
Rodrigo Lopez started for Mexico and gave up two hits in three scoreless innings. He was relieved by Pablo Ortega, who allowed three hits and a run in 2 2-3 innings.
Evan Frey was 2-for-2 with two RBIs for the Diamondbacks. Arizona regulars Mark Reynolds and Miguel Montero each had a pair of hits.
It was Mexico's third exhibition game against a major league team before the World Baseball Classic. Mexico opens WBC play against Australia on Sunday in Mexico City.
San Diego Padres first baseman Adrian Gonzalez said he was optimistic about Mexico's chances despite the decision of several major leaguers not to play for Team Mexico.
"We are able to play very good baseball," he said. "The difference between the 2006 team is that we are really integrated. It is a well-built roster, and I am sure we are going to do a very good job."