How to acknowledge an "anonymous" referee who identified themselves
I agree with @Boris Bukh's comment: as a general rule, feel free to acknowledge whom you want...but if there is any real worry that your acknowledgment could be received unfavorably, ask the acknowledgee first.

I think yours is a "nondegenerate case" of that above principle.  In particular, by choosing your language carefully, you can acknowledge the non-anonymous referee without disclosing that they were a referee.  E.g. you could write "I would like to thank A. Professor for XX.  I would also like to thank the referees for YY."  As long as XX does not equal YY, you are not being dishonest or misleading; you are just choosing not to reveal certain information.  (If XX equals YY, it's not so clear why you need to acknowledge A. Professor by name.)  If you decide to do this, sending the proposed acknowledging text to A. Professor for their approval might be a good idea.