Throughout the Bible, we are shown instances where God trumps the idols of others. In this case, these men put their faith in their own abilities as sorcerers. That faith in something other than God was about to cost them their lives.

Time and time again, God gives us examples of people who worshiped things other than Him and time and time again, it ends badly for them. And yet I find myself worshipping things I shouldn't all the time. I consistently put other things before Christ. Ultimately, those things are hollow shells and don't fill the gaping hole in my soul like Christ does.

Daniel 2:11-12