Ana Ivanovic evened the round-robin event by overwhelming Australian 16-year-old Ashleigh Barty 6-2, 6-3. Barty made a positive start, but once Ivanovic made the first break to lead 4-2 she took control. The Serbians combined to win the mixed doubles 6-4, 6-7 (8), 10-6.
Tomic put Djokovic under pressure right from the start, holding five break points in the opening game. Djokovic survived that threat and held a break point of his own to lead 5-3 but netted a backhand. Tomic broke serve in the next game with a crosscourt forehand winner and served out the set.
He kept up the pressure in the second set, failing to convert a break point to lead 4-3. But he won his sixth break point at 5-4 and he served out his first win over Djokovic in four tries.
"I played a very, very good match," Tomic said. "I'm just happy after the training the last few months, that it's all coming good and the training's paying off."
Playing before more than 13,000 in the sold-out Perth Arena, Tomic admitted to feeling nervous at the start.
"Very difficult to play the first few games," he said. "It's very hard playing against a player like Novak and come out relaxed. But I'm happy the way I came out. I was serving really good and the whole match was on my side because my serve was working really well."
Djokovic was generous in defeat and conceded that Tomic deserved his victory.
"He played really well. He deserved to win," Djokovic said. "I knew I was coming here to Australia really late and it still takes time for me to get used to it. But I'm not taking anything from his win. He played terrific. He's in great form. I was always on the back foot and he was the better player."
Earlier, Italy rallied to beat Germany 2-1.
John Isner withdrew from the Hopman Cup
on Thursday because of a right knee injury, ending the American
team's chances and handing a championship berth to Spain.
Australia will face Italy.
Information from The Associated Press was used in this report.