Maynard lashed the ball into the top corner from the edge of the penalty area in the second minute of time added on to secure the Robins' first league win since August.
It was rough on Barnsley, who had looked the more likely of the two sides to pinch all three points after substitute Craig Davies had struck his first goal for the club to cancel out Albert Adomah's early opener.
Barnsley made two changes to the side that lost 5-3 at Cardiff last weekend, with defender Scott Wiseman and midfielder Nathan Doyle back in the side.
Midfielders Martyn Woolford and Khalifa Cisse and defender Ryan McGivern were all recalled by McInnes, taking charge of his second game since replacing Keith Millen.
Liam Fontaine headed McGivern's eighth-minute corner just off target as the visitors looked to make an early impression and they took the lead six minutes later when springing Barnsley's attempted offside trap.
Nicky Maynard slipped a deft throughball in between the Tykes' flat-footed defence and Adomah kept his composure after racing clear to slide the ball under home goalkeeper Luke Steele.
City midfielder Neil Kilkenny had a goal-bound shot blocked by Tykes defender Stephen Foster and Maynard forced Steele into a smart save with a shot from 25 yards as the visitors chased a second goal.
Barnsley at last responded through skipper Jacob Butterfield, who let fly from 25 yards shortly before the break only to see former England goalkeeper David James keep the ball out at full stretch.
Danny Drinkwater lashed a 30-yard free-kick over the crossbar shortly after the break, but Maynard went close to doubling City's lead when his shot from inside the penalty area was blocked by Wiseman.
Barnsley stepped up a gear and Drinkwater lifted his 12-yard shot off target and Butterfield fired in a thumping 25-yard drive that whistled over the crossbar.
Butterfield, yet to sign his new contract offer at Oakwell, went even closer in the 60th minute when another shot from outside the area smashed against the upright.
The Tykes continued to pepper the visitors' goal, through defender Jay McEveley and winger Jim O'Brien, and deservedly hauled themselves level through Davies in the 74th minute.
Davies, a 58th-minute replacement for Matty Done, converted McEveley's cross into the area from 12 yards, right-footed into the bottom corner.
The home side sensed all three points were there for the taking. James pulled off another super save to turn away another effort from Davies and Foster headed the subsequent corner inches wide.
Marvin Elliott then saw his snapshot pushed away at full stretch by Tykes goalkeeper Steele, before Davies's angled drive was well saved by James.
Time appeared to be running out when Adomah burst clear on the right, but his cross found Maynard unmarked on the edge of the area and the striker smashed home his fourth goal of the season.