I'll start with this part as it's easiest to answer:
or do I need to wait for the other application to be finally denied
-> No. What you can patent has nothing to do with what others have a patent for or do not get protection for or anything concerning their protection.
For an invention to be patentable, it has to be novel (unpublished) and inventive (not obvious for someone skilled in the art from a point of view where he knows everything that has been published).
It is possible (and not rare) for patents to have overlapping scopes of protection. For example, if I patented the wheel made out of solid stone and you patented one out of wood afterwards, it is entirely possible that my claims emcompass every kind of wheel and yours the wheel made out of wood. Somebody who wants to sell wheels made out of wood would then have to get a license from both our patents (or would infringe them).
The problem with your invention could be novelty or inventive step. If the other patent encompasses your invention, it might be deemed obvious.
This can only be answered by looking at the exact specifications of this case. If you want to try it yourself, start reading articles and explanations on inventive step. However, I would consult a patent attorney, they can help you with determining which part, if any, of your invention is patentable and with patenting it.