If your counter-problem is perceived as being greater than the original, you either come across as bragging (the "Agony Aunt" syndrome) or dismissive ("How can you worry about that petty problem when people are DYING?"). Either way, you're basically saying that the original problem isn't a big deal, and that the person who brought it up is wrong to even be worrying about it. That rarely ends well.
If your counter-problem is perceived as being the lesser of the two, now you're a self-centered jerk, like in Weird Al's "Why Does This Always Happen To Me?" Now you're not only dismissive of the other problem, you're clearly wrong to be that way.
It's possible for you to think your problem is greater and the other person to think it's lesser, which combines the worst of both worlds. People who are proponents of the rights of groups currently in power often manage this trick. "My group is oppressed too!" says the one benefitting from the oppression of the other group. They may honestly think that the pendulum has swung too far the other way, and now men/whites/Christians/rich people/whatever are suffering more than anyone else, so now they're dismissive jerks who also appear to be horribly out of touch with reality from the viewpoint of anyone not on their side.
And, of course, it's possible for the counter-problem to be utterly unrelated to the original, at least as far as the poser of the original problem is concerned. Now you look like you can't even be bothered to pay attention to what you're arguing about.
Finally, even if your goal is to show empathy by pointing out you've been there, etc, you run the risk of any of the above problems in a slightly lesser severity. This can range from the comically inept ("Homeless, eh? I feel ya. Once I locked myself out of the house and had to hang around on the porch until my wife got home.") to a waste of breath (sometimes you just can't convince someone that their pain isn't unique).
The moral of the story? If someone brings up an issue, address it. Don't bring up a counter-issue. Whether you're trying to help, trying to make someone feel better, or trying to convince them that the issue isn't really a problem, do it directly, not by pitting it against a competing problem. You may not win the argument, but you're not really going to win in any useful sense by bringing in a counter-problem, so you might as well lose without looking like a jerk.