It sounds like some apps were purchased using one (or more) different Apple IDs. You do not own those apps, so you will need to obtain the permission of the owner to use them.
The way to do that is for the Apple ID owner of the apps not owned by you to "Authorize This Computer" in iTunes on your computer. You can find the "Authorize This Computer" link under "Store" in the iTunes menu.
Have the owner authorize your computer using their Apple ID and password, then sync to your iPhone.