The expression goes back to the 15th century. It became more colloquial and slang in later use.
1. ‘Under no circumstances’, ‘absolutely not’. Also used (esp. humorously) as an emphatic expression of surprise or disbelief. slang in later use.For humorous rejoinders to no way, see WAY int.1 2 and yes way at YES adv., n., and int. Phrases 5.
[1711 LD. SHAFTESBURY Moralists III. ii. 215 For Body can no way be the Cause of Beauty to itself. No way.]
1787 R. v. Ince in Session Papers 1786–7 (Old Bailey) 1169/2 Could there have been any penetration of the hymen in that condition?—No, sir. There could not?—No way, it was impossible.
1852 H. B. STOWE Uncle Tom’s Cabin I. iv. 43 Dem Lincons an’t much ‘count, no way!