BOSTON — The company seeking to build a $5 billion natural gas pipeline in Massachusetts has proposed an alternative route that includes part of southern New Hampshire.

The route would travel from New York into western Massachusetts for 63 miles, then turn north and continue for another 70 miles in southern New Hampshire before turning south again into Massachusetts, ending in Dracut. Under the original proposal, Kinder Morgan Inc. planned to run the pipeline 127 miles through Massachusetts.

The proposed pipeline has sparked opposition to the project in many Massachusetts communities.

U.S. Sens. Elizabeth Warren and Edward Markey are among the Massachusetts politicians who have opposed the plan outright. Environmental activists have also opposed construction of the pipeline.

“We’re trying to adjust the line to respond to those concerns,” company spokesman Allen Fore said Friday. Fore said the proposed path would weave through 16 Massachusetts communities and 17 communities in New Hampshire.

One goal of the new path is to steer the pipeline away from largely undeveloped lands by following existing utility or developed routes. The path would also cut through the properties of far fewer Massachusetts landowners, according to the company.

Fore said Kinder Morgan doesn’t plan to officially file for federal permits to build the pipeline until the fall. The firm hopes to break ground on the nearly two-year project in early 2017.

The ability to expand the natural gas capacity for the region should help lower energy costs, company officials have said.