Giving the counteroffer anyway will get every other member of your team searching for a job. There's this company I stayed at for a whole 6 months. I came in after negotiation a sensible salary: Nothing spectacular, but still pretty good. Early inquiries at the job made me realize I was paid 25K more than any of my teammates! While I was the most senior, I wasn't quite that far ahead: They were getting underpaid. Realizing this too, one of them quit, and got a counteroffer to be paid just like I was. News spread like wildfire, and entire teams were interviewing out there. Some people stayed with the counteroffers, but many were lost.
When you are not paying people what you are really willing to pay them, eventually they'll learn about this, and hell will break loose. You either have to change the way you pay, or be OK with losing people. Counteroffers get you the worst of both worlds, and on top of that, they are wonderful sources of lawsuits in the long run, as the people that won't complain are typically women and minorities.
The one counteroffer that make sense is to go and say 'look, now we realized that we are underpaying, but we want to keep you all, so we are doing an immediate salary review'. You still look like someone that isn't on the ball, but at least you show you are trying to have equitable pay.