Djokovic lost in straight sets to Tomic and Serbia had to rely on Ana Ivanovic to beat Ashleigh Barty before edging to a 2-1 win in a tight mixed doubles rubber.
Tomic never really looked in trouble against the top ranked player in the men's section and an upset in Group A looked on the cards.
But Ivanovic made short work of her young opponent and eased to a 6-2 6-3 victory.
The Serbians then teamed up and looked on course for a comfortable win when they took the first set 6-4.
But Tomic and Barty battled back to win the second set 10/8 on a tie-break.
That resulted in a champions tie-break which Djokovic and Ivanovic won 10-6 to record Serbia's second group win of the tournament.
Francesca Schiavone and Andreas Seppi had earlier earned Italy a 2-1 win over Germany in the other Group A match.
Italy had to come from behind to clinch the tie after Seppi lost his singles to Tommy Haas.
Schiavone defeated Tatjana Malek before teaming up with Seppi to win the mixed doubles.
Seppi had been in a position to win both sets against Haas before losing 7-6 (7/3) 7-6 (9/7), Schiavone then defeating Malek 3-6 6-3 6-3. The doubles went 6-4 7-5 in Italy's favour.
Malek had arrived in Perth only on the day of the match as a replacement for the injured Andrea Petkovic and slipped 3-0 behind in the opening set before hitting back to claim the next six games.
Schiavone recovered from an early break in the second set to win two games on her opponent's serve to level the match with a 6-3 score.
An early break in the deciding set was enough to put Schiavone on course for victory as she took it 6-3.
The doubles saw Schiavone hit top form as she and Seppi combined to break the Malek serve and take the opening set 6-4.
The second set was completely different and saw six consecutive breaks of serve.
Malek suffered four breaks of serve in the match and following the last of those Schiavone took the chance to serve out for the match.
The win was Italy's first of the tournament after defeat to top seeds Serbia, but the loss for Germany left them bottom of Pool A and with no chance of making Saturday's final.