Two judges scored the fight 114-112 to Gradovich, while their colleague had Dib ahead 114-112.
Each man was deducted a point by American referee Eddie Claudio in the eighth round for excessive holding.
It was a scrappy and rugged fight featuring countless inside exchanges, with Gradovich constantly coming forward.
Dib (35-2, 21 KOs) started well, but Gradovich (16-0, 8 KOs), who had never gone beyond 10 rounds, gained confidence as the bout progressed.
He sent Dib reeling with a powerful left hook in the fifth.
Dib tried to work to the head and body, but couldn't find the power punches to put the American-based Gradovich on the back foot.
Gradovich landed some power shots in the last two rounds and his greater punch output proved decisive.
The Australian was cut by an accidental elbow near his left ear early in the fight and finished the bout with blood pouring from a wound near his right eye.
For Dib, it was his first loss in four-and-a-half years and 15 fights, since his only other defeat by Steve Luevano.
Robert Garcia, who trained Luevano that night, was also in Gradovich's corner, as the challenger completed a fairytale after taking the fight at short notice.