PhD student funding from another professor? I'm a PhD student in the (probably) final third of my work, and I'm in the comfortable position that I have two options to continue my doctoral efforts for the next two years.

The problem is: the job offered by my supervisor is probably related to project work that has nothing to do with my dissertation. The other position is in another department of the university with another professor but fits very well thematically to my doctoral thesis.

What option could I choose here so that
  my supervisor is not embarrassed if I refuse his offer and
  my doctoral thesis is finished successfully and in time?
This might be highly dependent on your personal situation and there might be more implications. Please note that the other professor might have additional requirements or wants to see additional topics in your thesis.

I would try to address this issue openly and talk to your supervisor. Express clearly that you have the goal of finishing your dissertation in the next two years and discuss whether this is possible with his offer. Ask him whether this project is really not related to your dissertation and how much effort and time it will take. If you realize that this is not a viable option for you and if there is no other acceptable solution, explain in a friendly manner that you consider alternatives.

Trying to hide everything from your supervisor and suddenly vanishing is definitely not the way to go as this might burn bridges.