Most likely you'll have to treat each account separately: sign in with the first, buy and download the DLC, then sign in with the second and repeat the process.
Downloadable content is normally tied to the account that purchased it, so a single purchase usually won't cover both. It's worth checking the platform's licensing terms first, though — on some consoles a purchase can be shared across accounts on the same machine.