Apple does not maintain past, full installers of its Pages, Numbers, and Keynote applications. Those that are in the Mac App Store are the only versions available, and require High Sierra or later. Apple retired the iWork '09 applications in early Fall 2013, and these are not available from Apple either.
Apple's licensing terms require that you follow the steps in What to do before you sell, give away, or trade in your Mac, before you gift it to anyone else. In the case of the 2009 MacBook Pro that did not ship with Yosemite, you will need the original installation DVD that came with the Mac, as you are required to install the operating system that shipped on it when new.