Two of the finest midfielders of their generation went head-to-head on the touchline for the first time in a competitive match and it was Gerrard who was able to celebrate a second consecutive victory since he left Rangers for the West Midlands club.
An early goal by Targett put Villa in the ascendency and McGinn wrapped up a deserved three points late on before Marc Guehi netted a consolation for the hosts in stoppage time.
Gerrard had to wait 84 minutes for his new team to open their account under him last weekend but they opened the scoring much earlier in south London.
It came through an unlikely source too with left-back Targett rifling home from Ashley Young’s corner to score for only the third time in the Premier League.
James Tomkins, recalled in place of the injured Joachim Andersen, had been at fault with Targett his man and he also mistimed his jump while trying to head Young’s cross away to ensure Palace conceded a 10th goal from a set-piece this season.
Aside from Wilfried Zaha’s left-footed effort dragged wide early on, it was largely Villa doing the running during the opening 45 minutes.
The two changes made by Gerrard from the win over Brighton had paid off so far with Leon Bailey and Young causing numerous problems while McGinn went close to making it 2-0 in the 27th minute, but curled wide.
Young was the next Villa player to fire off target and with Palace clearly lacking rhythm, Vieira would have welcomed the arrival of half-time.
There was an improvement from the hosts after the break and Conor Gallagher produced an excellent delivery across the face of goal but on the hour mark a change was made.
Captain Luka Milivojevic was withdrawn after a difficult afternoon and Ebere Eze, fit again after an Achilles injury, was introduced for his first appearance since May 16.
It was a bold call by Vieira given the playmaker’s long lay-off and he made another when Zaha was replaced by Odsonne Edouard soon after.
Gerrard had also turned to his bench by this point and saw substitute Douglas Luiz shown a red card with 18 minutes left at Selhurst Park only for VAR to intervene.
Referee Michael Salisbury, taking charge of his first Premier League fixture, was asked to review the incident and downgraded the tackle on Cheikhou Kouyate to a yellow.
It added to the frustration of the home supporters but Palace did finally muster a shot on target when Christian Benteke fired straight at Emi Martinez from Tomkins’ knockdown and Edouard did the same not long after.
Villa were to ensure boss Gerrard finally tasted success at Selhurst Park though when they grabbed a second with four minutes left.
Substitute Anwar El Ghazi dribbled into the area and teed up McGinn who was able to curl into the corner on this occasion for his third goal of the season.
Guehi tapped home from Kouyate’s cross to pull one back for the home side in the fifth minute of stoppage time but Gerrard, who failed to win as a player in six outings at Palace, watched his team hold on for another victory.