Being from the USA, I can confidently say “Yankee” is a term that is fairly neutral in meaning. People from the South states use it to refer to basically any American not from the South, and I get the sense people from the UK use it to refer to anyone from the USA.
In my experience, “Gringo” seems to be a term used by Spanish-speakers (even ones from North and South America) to refer to English speakers who think they’re better than everyone, so it appears to be a term with negative connotations
Do Southerners use Yankee pejoratively to refer to northerners?