Federer, bidding to equal Pete Sampras' record 14 Grand Slam singles titles, was off target with some forehands initially but quickly found his rhythm in the breezy conditions.
The 27-year-old Swiss star broke Moya in the 8th game of the second set and converted on his first match point in the next game, setting it up with an overhead winner.
"I was a bit rusty in the beginning but it was a good match overall," he said. "I thought I played OK.
"I was just feeling out ... trying a few things here and there, it was just a matter of getting used to the conditions, getting my footwork right."
Federer said he used the eight-man exhibition tournament at the former home of the Australian Open to get a gradual buildup for the season's first major, starting Monday in Melbourne.
He said he lost the final here to three-time winner Andy Roddick in 2007 then easily beat the American in the Australian Open semifinals less than two weeks later. After winning the 2005 title at Kooyong, he was upset by Marat Safin in the Australian Open semis.
Federer said he was underprepared after the offseason when he started 2009 with a loss at an exhibition in Abu Dhabi to Murray, who also beat Nadal in the tournament featuring six of the top 10 men.
"I'd rather not play them," he said. "You might not see the real guys playing each other, they might be trying to hide something away.
"That's why Abu Dhabi was tough for me. It was an unusual first match of the season for me and not very comfortable."
He also lost to Murray in the semifinals last week at the Qatar Open, where the Scottish player defended his title.
Moya was a less difficult mark. The 32-year-old Spaniard held the No. 1 ranking in 1999 and won his only major at the French Open in 1998, the year before Federer played his first Grand Slam event.
Federer had to withdraw from the Kooyong tournament last year with an illness that had bothered him for months and sapped his confidence ahead of the Australian Open.
After a slower than usual start to the season, Federer's five-year domination at Wimbledon was snapped in a classic five-set final loss to Nadal. He later surrendered the No. 1-ranking he'd held for 237 consecutive weeks to the Spaniard.
But he finished off by winning his fifth straight the U.S. Open to lift his career total to 13 majors, one shy of the record Sampras set during a 14-year career.