You can apply for an extension on the basis of being married to a Thai at an immigration office in Thailand.You'll need to show 400,000 baht in a Thai bank account OR proven income of 40,000 baht a month. You will then not need to leave the country BUT you will then do 90 day reports if you stay more than 90 days in each period.
Then you either go to immigration, pay the 2 days overstay and ask for a 60 day extension to visit your wife (you will get 58 days because your already 2 days over) so a total of 2900 baht OR leave the country, pay the 2 days overstay and come back in again on a new 90 day entry. If you leave it, then it ramps up 500 baht a day in fines and your risking a ban of a year if your caught and arrested on overstay.
If your looking at flying from Chiang Mai and getting the rentry permit in Bangkok, you best make sure you not clearing immigration in Chiang Mai and then find yourself in the transit hall in Bangkok. It will then be too late.