You can try, but playing hardball like that can lead to problems unless you have a paper trail that shows you alerted the landlord to the necessary repairs and he received the complaint (a 'Certified Letter' usually works). Personally, I'd try everything possible before withholding rent, because having a bad relationship with the landlord never works out well.
If you want to be sure you are ok legally, put the rent into an escrow account. If this takes more then 1 month, put the rent into the account each month. If you don't a court will likely look at this as you just trying to get out of paying rent.