Animate 3D Object into 2D Backdrop

I have a simple JPEG of a bookshelf, and then I created a 3D model of a book. I want to create a little animation where the book first appears to be resting on the bookshelf, and then it’s pulled out.

It seems as though there might well be a quick and easy way to achieve this, but what I’ve tried is ineffective, and what I’ve thought of seems too cumbersome. Can anybody suggest a process for achieving this so it looks good (and hopefully doesn’t take TOO long).

Please note that I’m okay with Gimp, too, so anything that would require using that is fine, also. Thanks as always.