The only time the insurance department of Massachusetts is going to know if someone has car insurance or not is if they are required to file an SR-22. Drivers that have serious citations such as driving under the influence, reckless driving, or causing a car accident while driving uninsured may have an SR-22 requirement put in place by the court.
Having an SR-22 requirement means that you have to prove to the state for three continuous years that you have an auto insurance policy with liability coverage. Nobody else needs to prove to the state their car is insured so you cannot find out if they have coverage or not through any government authority.
This means that realistically the only way you're going to know if a car you are borrowing is insured or not is to get a proof of insurance card from the owner of the vehicle.
Like most states, in Massachusetts the insurance follows the vehicle rather than the driver. So your friend can loan you their insured car and you are covered the same as if they were driving it. However, this doesn't hold true if you live at the same residence as the owner or have regular access to the car. If either of these applies you need to be listed on the insurance policy in order to be covered.