There is no real-world physical mechanism that can make almost-light-speed travel work like you are describing. If the black hole is five light years away, and the space-craft travels at almost-light-speed, the space-craft will take just a little over five years to travel to the black hole from the point of view of an observer on Earth. Depending on how close to light speed the space-craft was traveling, there will be relativistic time dilation effects, so the astronaut in the space-craft will experience a briefer time (perhaps much briefer).
The black hole, on the other hand, can produce effects like you describe. This is also a case of relativistic effects--mathematically speaking, high gravity acts just like any other form of high acceleration. So you could feasibly have a space-craft travel to the black hole, spend a (to the astronaut's frame of reference) fairly brief time in the gravity well of the black hole, yet have an observer on Earth experience millions of years. This could happen--theoretically.
The problem is, it most likely could not happen practically. For a stellar-sized black hole (a black hole created from the collapse of a massive star), a space-craft that is close enough to the black hole to experience that degree of time dilation will also experience massive tidal effects. These effects will be enough to shred any space-craft no matter what materials it is made from: no material humanity can or could possibly make could withstand that degree of force. And if the space craft did not shred from the tidal forces, the people inside most certainly would. Now, you could get around this by making the black hole a super-massive black hole (billions of times the mass of our Sun), but with most black holes that readers may be familiar with, that is less workable.
Now, if you are writing a story or creating a setting for an RPG campaign, you could (of course) completely ignore the tidal effects. You could decide the tell the audience that the ship is made from some material that ignores the force, or that blocks gravity. That's up to you--tell your story, and if the physics doesn't work, ignore or explain away the parts that don't work for you. But for a hard-science campaign or story, this may not be what you're looking for.
Now, you could completely ignore the black hole, and simply have the intended destination be millions of light years way. Traveling very close to the speed of light, the astronaut may only experience ten years in transit back and forth, but on Earth millions of years will have passed. That gets you the same results, is a LOT easier to calculate, and still gets you the setting you need.