What is the specific error message that gets displayed when you try to add another device? And is it an OS X or an iOS device?
Also, did you try following the instructions here yet?
That is strange. According to Apple's website, the device limit for iTunes Match is 10, not 5.
However, there is a 5-computer limit when it comes to 'Authorizing' your computers to play your content. When you say you "removed" the two devices, did you actually de-authorize them (which means they would be computers), or just delete them from the "Manage Devices" section of your iTunes Store account (which means they were iOS devices)?
If I understand it correctly, you'll actually need to "de-authorize" one of your computers on your iTunes account first. If you don't currently have 5 computers with iTunes installed and connected to your Apple ID, you might want to click on the "de-authorize all" button in your iTunes Store account home page, and then go back through and systematically authorize only the computers you are actually using with iTunes.
The issue is you have 5 computers currently authorized on your Apple ID and cannot add more. In iTunes pull down Store > View Account. After you enter your credentials you'll see your iTunes Store account page. In the upper-center you'll see "computer authorizations." It will tell you that you currently have 5 computers authorized. You'll need to de-authorize one of those computers before you can add a new one.
Computer Authorization is different from device association to an Apple ID. You may have a total of 5 computers authorized to you Apple ID but you may have up to 10 devices associated with that same Apple ID. 5 of which may be computers.
From my understanding, the "authorized computers" refers to the ability to play DRM protected media bought in iTunes. You are allowed to have 5 authorized computers that can play DRM protected songs / videos etc.. If you want to remove a computer from that authorized list, you have two choices. The best option is to log into that computer and from iTunes "Store" pull down menu, you can de-authorize that computer.
If you no longer have access to the computer any more, your only option is to deauthorize all computers. This is not as bad as it sounds. After deauthorizing all computers, when you go to play DRM protected songs on your current computers, you can re-authorize them again without any problem. The only real problem with deauthorizing all computers is that after you do it, there is a time limit before you can deauthorize all again.
The authorized computers have nothing to do with iTunes Match.
For iTunes Match, I believe you need to go to iTunes, check your account, and then under the "iTunes in the Cloud" section, you need to "Manage Devices". I think that these are the devices that count against the 10 device limit, and from here you can remove devices that you no longer need. The only issue that I had with this page is that the name of the device is not always clear. I have a laptop and a mac mini, and they are both listed as "Mac (mac)". If I wanted to remove one of these devices, I would have to guess at which one needed removing. It would be nice if the list showed the model number rather than just "Mac" or "iPhone" or "iPad".