You determine if the licenses are compatible first. If they are, you're fine, as long as you fulfill the terms of both licenses.
If they aren't compatible, then you can't use them together, so you have to find something else, or build the functionality yourself.