Hi, and Welcome to the Great American RoadTrip Forum.
It would be very helpful to the members here if you posted the complete plan of your trip, so those who give advice are able to see the whole picture.
For example, I would urge you to fly into NYC and visit there, before picking up a rental car. You will not want a car in NYC. Parking is nigh on impossible to find and very e xpensive. On the other hand, public transport is excellent. And you will want to spend a lot of time walking. Then I would head to Boston, and find a hotel out of the city, near a railway station. Boston too, has excellent public transport, and is expensive for parking. (Actually, I would probably pick up the car after visiting Boston, before heading to Cape Cod, and take Amtrak between the cities.)
Lifey