Stephen Gallacher set his sights on a place at next year's Ryder Cup at Gleneagles after ending an eight-year drought on the European Tour by landing the Dubai Desert Classic title yesterday.

The Scot calmly fought back from forfeiting a three-shot overnight lead within the first two holes to notch a three-shot success over South Africa's Richard Sterne with the help of an eagle at the par-4 16th, his fifth of the tournament.

Gallacher, runner-up to Lee Westwood last year, matched the event's 72-hole record after shooting one-under-par 71 in the final round to finish on a 22-under-par total of 266. The 38-year-old from Bathgate, whose last victory had come at the Alfred Dunhill Links Championship at St Andrews in 2004, is now determined to make the most of the next 21 months to qualify for Paul McGinley's Europe side.

"Next year is a Ryder Cup year, so the big goal is to get myself in the top 50 in the world rankings because you're not going to have a chance of making the team if you're not up there," said Gallacher , the nephew of former Ryder Cup captain Bernard Gallacher. "It's in Scotland and I guess it will be the last in my generation, so for my family, that would be the ultimate. The family history of playing the Ryder Cup is an extra motivation to qualify."

Gallacher, who broke Tiger Woods' 54-hole tournament record with a best-ever round on the Tour of 62 on Saturday, added: "I just wish I knew why it's taken me more than eight years to be sitting here in the media centre on a Sunday afternoon.

"It's not for the lack of trying, so I wish I could put my finger on it. It's the first time I've ever been leading going into the last round and all the times I've finished second I've come from behind.

"I've had five eagles this week and I won a car for a hole-in-one here last year and had a hole-in-one at the Dubai World Championship. Dubai seems to be one of these places that keeps happening for me. But you need breaks out here like that I one I had on 16."

Sterne had drawn level with Gallacher after birdies at two and three but the momentum shifted again with a stroke of Gallacher brilliance from the rough. Sterne said: "Everything swung round with Stephen's shot at 16. It kind of took the wind out of my sails. It's just one of those things you see in golf and it's tough to beat a guy when he's does something like that."

Gallacher's prize cheque of £262,817 lifted him from 139th to 64th in the Race to Dubai and he also qualifies for the WGC-Accenture Match Play Championship in Arizona later this month.

"I've only played in one WGC so event so that's going to be exciting," he said. 'This win also gets me into the Bridgestone Invitational and should also get me back in the PGA Championship the week after. It is going to open a lot of doors for me and I am conscious now of taking full advantage of those opportunities.

Among the first to congratulate Gallacher were his fellow Scots Craig Lee and Marc Warren. Warren posted a final round 67 to share 17th place on 11-under par, three shots ahead of Lee who finished in a tie for 37th after a 70. A final round of 78 left Chris Doak in a share of 52nd place on five under.

Warren said: "It's a great victory and I still can't believe it's only Stephen's second. We're all just delighted for him. On top of what Paul Lawrie achieved last year and Scott (Jamieson) winning the first event of this season, it's all going well for Scottish golf."

Gallacher's victory meant a double celebration for his caddie, Damien Moore, who collected a seventh Tour win on his 42nd birthday. The Englishman, who has recently moved to Livingston, has been with Gallacher for three years.

Moore said: "This win has been coming and it's very satisfying that Stephen has won a second tournament. He's been hitting the ball well for a long time and was so cool under pressure this week – it's brilliant."