Investment firm MAG Capital Partners has acquired a nearly 145,000-square-foot building in Essex County as part of a sale-leaseback with the owner of a cosmetics manufacturer.