Acknowledging a reviewer from a journal from which the paper was rejected
First, I think it is good to acknowledge reviewers as you consider doing. It is the editor who rejects any papers based on the results of reviews so the reviews may still be very constructive and indeed helpful in improving a paper. So I would suggest something like the following
We/I (gratefully) acknowledge the (critical) review by X on an earlier version of the manuscript.
There are many ways to express it and what words you wish to use is up to you and the way you wish to express your gratitude. I would not add the name of the journal(s) where the reviews were conducted (other than in the letter to the journal editor accompanying your MS submission).
I also would like to take the opportunity to add that the following issue, not that it applies to your case but more to point out some bad practices for the community. The poor behavior concerns when someone acknowledges a famous persons review just to gain leverage in resubmitting it to another journal. I have seen how persons have used reviews stating that the paper should be rejected because it is "crap" as a "most valuable input to help improve the manuscript". Since no-one typically knows what this review did, the gut reaction is to think it must have been valuable since the reviewer is well known. For this reason it is good to provide the review/revisions from the old MS when re-submitting it so that the review-revision work becomes obvious to the editor.
As a final point, I would not add the acknowledgement of any reviewers new or old until the time when your MS has been (hopefully) accepted in the new journal.
EDIT: Based on the good comments by Tara B on anonymous reviewers and how to distinguish reviews from old and new MS I would write something as the following
We/I (gratefully) acknowledge the (critical) review by two anonymous reviewers as well as the (critical) review by another anonymous reviewer on an earlier version of the manuscript.
Words in parenthesis are optional and can be exchanged for others that better suit your needs.
Piotr has asked that I add one of my comments as an answer. Please note that I am a fairly inexperienced academic, so don't take anything I say too seriously!
Firstly, I'll reiterate one of my comments on Peter Jansson's answer:
You really really should not mention journal names or the fact that the paper was previously rejected. The journal you are publishing in would not appreciate it! (It makes it clear they were only your second, or in this case third, choice.)
Since you say that the helpful remarks of the earlier reviewer were about grammar, typos and a few small changes throughout the document rather than something that substantially changed the exposition of your paper, I think that conveying your thanks directly to the reviewer via the journal's editor (which you say you have already done) is probably a more appropriate acknowledgment, especially given the difficulty of making it clear you are thanking a reviewer from a different journal while not mentioning any names or the fact that the paper was rejected.
I have been waiting for a chance to pull a prank like
I would like to thank 15 anonymous referees from 5 journals to which this paper was submitted for their helpful comments.
but, as many people said, few journals will appreciate this sort of remark. It is true that this is what happens with most papers, so if we are to be honest and transparent, we should just state this sort of history. And it happens to the top researchers, too, although some people, judging by their productivity of 10+ papers a year, never get even requests for revisions.
May be a weaker form would be
I would like to thank the three anonymous referees and the associate editor of [THIS JOURNAL], as well as several other anonymous reviewers, for their helpful comments.
Sometimes, it happens that the most important revision was actually a couple of journals ago which really improved the paper, but that journal still did not accept the paper, so it cruised through another editorial board or two with just minor language remarks.