Both are extremely important but
Content marketing and writing is more essential than link building because without content, links can't be built. Also you have more freedom with the budget that you're allocating because content writer fees are usually cheaper than link building fees.