In my experience yes. (And it even does this
on your turn...! Cheating weasels...)
I even used this trick to beat them to an important wonder once or twice: if I find out, that they are about to finish a wonder 2-3 turns before me and I have no way to speed it up, I have already gifted them a new government, they went into anarchy, and I was able to secure the wonder...
But I guess, it only works, if the new government is considered "better" than the one they have. In the early game, when they are still a Despotism, it always works. But if they are already a Democracy and you gift them let's say Fascism, it may not necessarily work. The AI loves Fascism, but only when at war. Whether they consider Communism better than Rep or Demo, may depend on the size of their empire?!
The trick with the wonder was in a 20K game of mine. We were both building Bach's, and I was about to lose by 2-3 turns. The AI was already a Republic, so I needed something "better". But this being a 20K game, I was of course researching towards Shakespeare's as my next project and already knew Democracy. I gifted it to them and sure enough they revolted and lost a handful of turns in anarchy...
(But this required delicate timing: I had to be sure to finish my own Bach's Cathedral at least one turn before the AI could potentially acquire Free Artistry. Otherwise their Bach's might cascade into Shakespeare's, and that would be even worse than losing Bach's... But no one knew Democracy yet at that point, and therefore no Free Artistry, so it was clear that I would be able to complete Bach's and get a little head-start on Shakespeare's, before any AI would learn Free Artistry, which I was of course not going to trade away...)
They way it went, was that the competing AI cascaded into Sun Tzu's (for which I didn't have much hope of getting it anyway), destroying the cascade of quite a number of other AIs, who were building that (including one Sun Tsu build of their own...) So by the time the other more important wonders like Copernicus and Newton came around, no one had a pre-build going, and I got those without much danger, too.