A library is a specific piece of software that is intended to be consumed by another program. Typically, the library will address a specific/group of specific issues (although they can sometimes grow to a point where it's hard to identify what the original issue is/was). A library can be either internal or from a third party. Typically, a library is also something that is not executable, but requires the consumption.
A dependency, like the earlier answer suggested, is a relationship between two pieces of code. The first code calls out to the second code to either perform an action or return some information. The key part, though, is that the first code no longer has any control over how the action or information is implemented. This can be either a library, framework, database source, api call, or even a separate function. If you have a single function program, and decide to break out part of that into a second function that gets called, your main function now has a dependency on the second one. You might still have control over the new function, but your main function no longer has any control over how the work is implemented.