Preston North End's long wait for a home Championship victory continues as they went down to defeat against Barnsley.
The Lilywhites have not won at Deepdale in the league since February 23 and it was the Tykes who took the three points back over the Pennines with them.
Barnsley took a first-half lead when Sam Winnall slid in at the far post to turn a Marley Watkins cross over the line.
Aiden McGeady pulled North End level with a great finish on his debut, the Republic of Ireland international - on loan from Everton - firing home from 25 yards in the 64th minute.
The hosts were in the ascendancy by then and it looked like they would push on to win the game.
But 10 minutes from time, visiting substitute Adam Armstrong chased a long ball down the right channel with Alex Baptiste and reached it ahead of the Preston debutante after looking second favourite.
Armstrong cut inside and curled a delightful finish from the side of the box past Anders Lindergaard and into the far corner.
McGeady and Baptiste were two of three players making their Preston bow, Marnick Vermijl getting a second debut after joining from Sheffield Wednesday on deadline day - he was on loan last season.
Eoin Doyle came into the starting XI, replacing the injured Jermaine Beckford up front.
Also going out of the side beaten by Ipswich a fortnight ago were Bailey Wright, Chris Humphrey and Daniel Johnson.
North End started in a 3-4-1-2 system, with McGeady playing off front two Doyle and Callum Robinson.
They had an early sight of goal as Robinson's deflected shot from the edge of the box spun through into the arms of goalkeeper Adam Davies.
Barnsley threatened at the other end with a shot from Adam Hammill which went straight at Lindegaard and then an effort from Winnall which keeper Lindegaard had to twist in the air to tip over the bar.
Preston went close after quarter of an hour, Gallagher's free-kick from the left channel bouncing across the box without anyone getting a touch, forcing Davies to dive and spoon it against the far post.
A good spell of pressure from the visitors led to them taking the lead in the 28th minute.
It was an avoidable goal from a PNE point of view, the defence appearing to hesitate as a spinning ball bounced to Marley Watkins down the left side of the box.
Watkins' low centre was not cut out as it travelled across the box and Winnall arrived at the back post to slide the ball home on the stretch from close range.
North End put together a decent passage of play leading up the interval, inspired by some neat touches from McGeady in his free role.
Doyle's pass gave Gallagher the chance to move into the space down the right, his cross to the near post finding Robinson whose header at the near post was blocked at close quarters.
In the 44th minute, McGeady's lay-of from Gallagher's pass found the in-rushing Vermijl but his first-time shot was deflected behind.
When the resulting corner was cleared, McGeady returned in into the box with a chipped pass over the top of the Tykes defence.
Doyle managed to meet it but at full stretch could only put it behind.
If North End had not quite found their feet in the first half, they were much improved in the second period
In the early stages, Lindegaard did well to push out a whipped in free-kick from Adam Hammill - North End broke on the counter-attack and Robinson saw a shot blocked.
Tom Clarke met a deep Greg Cunningham cross and directed a header back across goal which dropped inches wide of the target.
North End began to work up a head of steam, a shot from Doyle deflected behind by Marc Roberts for a corner.
Gallagher and Vermijl worked a short corner routine, the ball played to McGeady who brushed past his marker on to his left foot and pulled the trigger from 25 yards, the shot flying into the far corner past the keeper.
You really fancied the home side to push on for a win, McGeady, Robinson, Hugill and Doyle getting chances but could not hit the target.
But they were undone by a sucker punch in the 80th minute, Baptiste and Armstrong setting off to chase and compete for a hopeful ball down the right.
Baptiste had a head start but it was Armstrong who got there ahead of him, although he still had plenty to do.
The on-loan Newcastle United striker turned inside with a neat back heal and curled a delightful finish past Lindegaard.
North End had chances to grab a second equaliser, Clarke forcing his way into the box and forcing a diving save from Davies at the near post.
Then in the 90th minute, McCeady drilled a low shot into the side-netting.
It is five defeats out of six for Preston in the league this term, all by a single-goal deficit.
PNE: Lindegaard, Baptiste, Clarke, Cunningham, Vermijl, Welsh, Gallagher (Johnson 77), Spurr (Hugill 60), McGeady, Robinson, Doyle (Makienok 80). Subs (not used): Browne, Pringle, Huntington, Maxwell.
Barnsley: Davies, Yiadom, Roberts, MacDonald, White, Kent (Armstrong 62), Hourihane, Scowem, Hammill (Kpekawa 90), Watkins, Winnall (Morsy 65). Subs (not used): Lee, Jackson, Bradshaw, Townsend.
Referee: Geoff Eltringham (County Durham)