In the biblical account found in the Book of Daniel, Chapter 6, Daniel is indeed thrown into the den of lions during the reign of King Darius the Mede. However, the specific law that Daniel broke is not mentioned in Chapter 6. The story revolves around the jealousy of other officials towards Daniel's favor with the king and their plot to find a way to accuse him. They tricked King Darius into signing a decree that forbade anyone from making petitions to any god or man other than the king for thirty days. Daniel, being a devout follower of God, continued his regular practice of praying three times a day to his God despite the decree. The penalty for violating the decree was being thrown into the den of lions, which is what happened to Daniel.
I hope this helps! :)