Change (?: ) to (?! ) to match if content of ( ) is not present:
\w+([-+.']\w+)*@(?!gmail).com
This will not match abcd@gmail.com, but will fail also on abcd@yahoo.com because no other characters allowed between @ and .com
To keep gmail.com blocked and to allow other domains change pattern to
\w+([-+.']\w+)*@((?!gmail\.com).*)
Note that when you have [-+.'] you tell to allow -,+,. and ' in the email address. Minus and dots are allowed but not plus and apostrophe.
So, finally
\w+([-.]\w+)*@((?!gmail\.com).*)