1825, "underground passage" (for water pipes or pedestrians, later for electrical wires), from sub- + way (n.). The sense of "underground railway in a city" is first recorded 1892, in reference to London.
Entries linking to subway
sub-
word-forming element meaning "under, beneath; behind; from under; resulting from further division," from Latin preposition sub "under, below, beneath, at the foot of," also "close to, up to, towards;" of time, "within, during;" figuratively "subject to, in the power of;" also "a little, somewhat" (as in sub-horridus "somewhat rough"), from PIE *(s)up- (perhaps representing *ex-upo-), a variant form of the root *upo "under," also "up from under." The Latin word also was used as a prefix and in various combinations.
In Latin assimilated to following -c-, -f-, -g-, -p-, and often -r- and -m-. In Old French the prefix appears in the full Latin form only "in learned adoptions of old Latin compounds" [OED], and in popular use it was represented by sous-, sou-; as in French souvenir from Latin subvenire, souscrire (Old French souzescrire) from subscribere, etc.
The original meaning is now obscured in many words from Latin (suggest, suspect, subject, etc.). The prefix is active in Modern English, sometimes meaning "subordinate" (as in subcontractor); "inferior" (17c., as in subhuman); "smaller" (18c.); "a part or division of" (c. 1800, as in subcontinent).
way n.
Old English weg "road, path; course of travel; room, space, freedom of movement;" also, figuratively, "course of life" especially, in plural, "habits of life" as regards moral, ethical, or spiritual choices, from Proto-Germanic *wega- "course of travel, way" (source also of Old Saxon, Dutch weg, Old Norse vegr, Old Frisian wei, Old High German weg, German Weg, Gothic wigs "way"), from PIE root *wegh- "to go, move, transport in a vehicle."
From c. 1300 as "manner in which something occurs." Adverbial constructions attested since Middle English include this way "in this direction," that way "in that direction," both from late 15c.; out of the way "remote" (c. 1300). In the way "so placed as to impede" is from 1560s.
From the "course of life" sense comes way of life (c. 1600), get (or have) one's way (1590s), have it (one's) way (1709). From the "course of travel" sense comes the figurative go separate ways (1837); one way or (the) other (1550s); have it both ways (1847); and the figurative sense of come a long way (1922).
Adverbial phrase all the way "completely, to conclusion" is by 1915; sexual sense implied by 1924. Make way is from c. 1200. Ways and means "resources at a person's disposal" is attested from early 15c. (with mean (n.)). Way out "means of exit" is from 1926. Encouragement phrase way to go is short for that's the way to go.