you can't just keep jumping ship because something might happen later. if you do you will spend your career at the bottom of the seniority ladder.
This might depend on the work environment. I can see this in blue collar, or a family-owned company where loyalty is rewarded.
In a white collar corporate environment, seniority isn't a factor. It is much better to push yourself into frequent moves that significantly stretch your abilities. It is often easier to get another company to take a risk on you in a new role or level than your own company. If you are excellent, this can pay off well with a series of moves across companies.
However, 5 months is really short. I would prefer 1 to 2 years, else you are burning bridges, and that has a tendency to catch up to you. You will run into someone you fucked over, and they will skewer you without mercy at the first opportunity. I can honestly say there is no-one out there that I screwed over to advance my career, and would be welcomed back in many places I worked at.
To the original poster - is this a unique opportunity? Can you tell them that you'd like to do it, but it is too soon to leave your current employer? They would understand that - they wouldn't want you to turn around and leave them in 5 months.
Furthermore, do you like what you are doing? Is your manager good? Do you continue to learn? These are factors, outside of money or advancement, that can help you decide whether to stick it out a bit longer.
If the money is a lot better, and your company is off the market rate for your skills, I would be open about you being recruited, and see what they can do. They might lay out more, or a roadmap for advancement.