Yes, you could be: you knew that the money was not yours; you knew it belonged to another person (even if you did not know who), and waiting 5 minutes is not the proper or adequate way to see if anyone returns for it. (You could have turned into the bank, for example, which could have determined who used the machine before you; or to the police, who have procedures for misplaced or lost property.) Therefore, you knowingly took property belonging to another person, whch is theft.