The Slovenian had 51 points as Jason Kidd's Mavericks earned a narrow 126-125 victory over the Spurs.