Manuel Pellegrini's side were beaten by Dundee on Monday but took a first-half lead through Scott Sinclair on Friday night.
Osman Sow equalised for the hosts after 57 minutes but Aleksandar Kolarov netted the winner 10 minutes from time from the penalty spot following a foul on Emyr Huws.
A second-string Newcastle side were beaten 2-0 by Gateshead in James Curtis' testimonial at Gateshead International Stadium.
The match began with a minute's silence in tribute to Newcastle fans John Alder and Liam Sweeney, who were passengers on the Malaysia Airlines flight that crashed in Ukraine.
Marcus Maddison and Greg McDermott put Gateshead two up before the half-hour mark and that was the way it stayed.