If by "outside library" you mean pure javascript/jquery, there are a number of answers to this question. They all propose the same solution, namely that the Controller is exposed via the DOM element id, see the following links:
Call Angular Function with Jquery
AngularJS. How to call controller function from outside of controller component
Creating a factory or service will not help as you have no way to inject/expose an angular service to a jquery function.
Rather than the above solutions, I would suggest trying to write an event handler. You could create an angularjs directive with a link function that registers a jquery custom event listener. The directive would contain a nested controller to handler the required logic. Your jquery/javascript code could then simply trigger the event (passing along any data required)
jQuery customer events:
https://learn.jquery.com/events/introduction-to-custom-events/
I think all of this is however, bad practice. I would recommend that you reconsider the design of what you are trying to accomplish.