There may be a couple of options. Don't know if they will work. There may be some issues with you not having bought the computer under your Apple ID.
1. You can download iMovie 9.0.9 and from there upgrade to iMovie 10 from the App store, and you should get the latest version of iMovie that will run on El Capitan. You can download iMovie 9.0.9 at this link:
Download iMovie 9.0.9
2. Another possibility requires your friend's cooperation. Again, I don't know if it will work. If he/she will put his version of iMovie in the trash, but not empty the trash, and then, on your computer, sign into the App store with his/her applie ID , then you can try to download iMovie onto your computer. Afterwards your friend can remove from the trash her/her iMovie folder and replace it in the Applications folder.
-- Rich