"Also, if both the company you are applying for, and the one you failed a drug test for use the same testing company, wouldn't the new company find out that way?"

Only if you sign a release form authorizing that info to be released. Thats why if you got nailed with a positive do not lisst that company on your job application.