This article is from the Dr. Pepper FAQ, by Christopher Flaherty with numerous contributions by others.
Yes. Coca-Cola was not invented until 1886, making Dr Pepper the
oldest of the current major-brand soft drinks in the United States.
In this case, I'm defining a "major brand" as one of the top ten
best-selling carbonated brands in the United States, of which
Coca-Cola is currently #1, and Dr Pepper is #6, as ranked by the
Beverage Marketing Corporation (http://www.beveragemarketing.com).
As for the other current major brands:
Pepsi (#2) was created in 1898 by Caleb Bradham in New Bern, North
7-Up (#8), a.k.a. "Bib-Label Lithiated Lemon-Lime Soda", was conceived
by Charles Grigg of St. Louis in 1929;
Mountain Dew (#4) was apparently first sold by Aloysius and Bernard
Hartman in Gatlinburg, Tennessee, in 1946;
Sprite (#5) was created by the Coca-Cola company in 1961;
Diet Dr Pepper (#10), a.k.a. "Dietetic Dr Pepper", was created by the
Dr Pepper company in 1963;
Diet Pepsi (#7) was created by the Pepsi-Cola company in 1964;
Diet Coke (#3) was created by the Coca-Cola company in 1982;
and Caffeine Free diet Coke (#9) was created by the same company one
year later in 1983.
If you're really curious: Moxie was invented by Augustin Thompson of
Lowell, Massachusetts, in 1876, the same year Hires Root Beer was
created by Charles E. Hires in Philadelphia. See? You learn
something new every day.