In my very long career, I have yet to hear a good story of someone taking said counter offer and staying very long, for one reason or another. I think it's a bad idea to offer it at all, as it sends a very clear message of what behavior is rewarded. When other employees learn that you will offer raises to counter offers, expect everyone to start interviewing.
Every manager knows which team members are key to the team's performance. They have to get raises or bonuses to match.