The Newburyport RR connected the Boston and Maine at Wakefield with Newburyport and via it's "City RR" extension to the wharves in Newburyport.
The above map shows the Newburyport Branch coming in from Georgetown. Note how it crossed the Eastern and had it's station on Pond Street in Newburyport and note the "City RR" branch down to the wharves. Above Newburyport you will see the line to Amesbury.
Above you will see the Newburyport Branch from Georgetown to Danvers. Note the former Essex RR crossing over the Newburyport line in Danvers. On the right you will see the Eastern and the Gloucester branch
Above you see the branch from north of Danvers to West Peabody Junction. You also see the S. Reading branch, on this map labeled as the Wakefield Branch, you also see the Eastern going through Beverly and Salem, the Salem and Lowell from Salem to West Peabody Jct, as well as the Essex Railroad going from Salem, Danvers, and then into Middleton.
Above you see the Newburyport line coming into Wakefield. Below that on the right is the S. Reading branch coming in from Salem, on the left side you see the Boston and Maine coming into Wakefield, to the left of that is the Boston and Lowell in Woburn, and the Woburn loop is just to the left of that, almost off the map. The line at the top is the Salem and Lowell as it heads towards West Peabody Junction.
The Newburyport line passed through the following towns.