You should not take a job at a company you'd love to work at but for a position you're not interested in (in most cases). This is especially true if you currently have a good job. The problem is this: If you accept a job you're not interested in at a company you’d love to work for, you'll always be hoping to get a different job at said company. But they haven't hired you for a different job. They've hired you for the job you have.
The exception to this advice is if you're unemployed or otherwise in a difficult employment or financial situation. And, if the job you're not interested in is in the same department as where you would want to work, it may be worth considering.
Whatever you do, if you end up taking the role, just remember – the company is hiring you for that role. You have to go in knowing that and expecting it.