Gallacher, whose one and only tour triumph came in the 2004 Dunhill Links Championship, posted a second-round two-under 70 in tricky conditions for a three-way share of second place on an 11-under total of 133, a shot behind South African pacesetter, Richard Sterne.
Doak cemented his place among the frontrunners with a spirited three-under 69 to lurk just two shots off the lead in a tie for fifth on 134.
The former Tartan Tour No.1 from Greenock is making his third appearance of the season after earning promotion back to the main circuit through last year's Challenge Tour rankings.
Doak achieved a career-best finish on the European Tour of sixth in the 2012 Austrian Open but this week's field in the desert is far stronger.
"It's a good two days' work especially as the wind was starting to get up near the end of my round," said Doak, who won the Allianz Open de Lyon on the second tier last season and has yet to drop a shot here this week. "I've been trying to eliminate the mistakes from my game, so to have no bogeys in two days is mission accomplished."
At 34, Doak still has plenty of years on the double major champion, Mark O'Meara, who became the Dubai Desert Classic's oldest winner at 47 in 2004.
Doak said: "It's not like football. There are a lot of guys out here whose careers have just started at 35 or 36, so that the way I look at it."
Gallacher, joint runner-up in Dubai last season, highlighted his round with three birdies in four holes around the turn. This time last year, he was three off the lead but this week he is just one behind and in prime position to strike.
"I'm only one place away and it's the place you want to be," he said. "I need to have a good one on Saturday to make sure I'm in the hunt come Sunday."
Sterne, who had opened with a sizzling 62, birdied his final hole in a 70 for a 132 and a narrow lead over Gallacher and European Tour young guns Thorbjorn Olesen (66) and Tommy Fleetwood (68).
Lee Westwood, the world No.8, has six shots to make up – and more than 25 players to pass – after a bitterly disappointing finish to his second round.
The Englishman, who shot 67 on Thursday, drove wildly into the sandy waste on the 359-yard par-4 17th and double-bogeyed one of the easiest holes on a course where he has three times been a runner-up. He then failed to get up and down from just over the last green and had to settle for a 71 and a share of 26th place.
Of the other Scots, Scott Jamieson, currently leading the Race to Dubai, finished in a share of 20th on 137 after a 72. Marc Warren, David Drysdale and Craig lee all made the cut, but Colin Montgomerie, Richie Ramsay, Scott Henry, Peter Whiteford and Ross Bain missed the three-under qualifying mark.