Have a look here. While the sandwich is roughly as old as the submarine, other names for the early sandwich existed, including "Italian", along with the slightly later Philadelphian "hoagie".
The sandwich itself seems to have been developed in the early 20th century in Italian communities in the Northeastern US. It seems it didn't have a name early on. The earliest reference to the name "sub" seems to have been from the 1920s. "Hoagie" is from roughly the same period, while "Italian" is a bit older.