He would have to go on your ML team. But after you acquire him, you can put him on waivers and hope. If he clears waivers, then you can assign him to a minor league team.
His being on the other team's 40 man roster has no bearing on whether or not you need to have him on your 40 man roster. But obviously if you put him on your ML team, he will go on your 40 man.