Lance Armstrong may have proved at least one thing beyond doubt: that there is, in fact, a more infuriating response to criticism than "Haters gonna hate". That response? "Haters of cancer-victim saviours gonna hate." Over and over, the most notorious cyclist in history has looked his accusers square in the face – an earnest, brick-jawed hugger of six-year-old leukaemia sufferers – and said: "The critics? I'm not doing it for them." After all, why would a cancer survivor use performance-enhancing drugs?

In hindsight, a lot of reasons suggest themselves; 125 million of them, you might say, one for each of the dollars Armstrong earned over a starry career in which he survived cancer to "win" seven straight Tours de France. At the time, however, Armstrong's miracle tale was largely believed. Not just believed: accepted as gospel, as doctrine for a charity fundraising empire, for a personal fortune and above all for a sport determined at all costs to put the 1990s legacy of drug use behind it.

In the aftermath of the scandal that disgraced Armstrong as a cheat and bully, one of those former believers, film-maker Alex Gibney, gradually realised he was sitting on a goldmine. He had been commissioned to make what most people expected would be an uplifting documentary about Armstrong's second comeback, for the 2009 Tour de France. The famous cyclist, thinking the movie would be a puff piece, gave Gibney unprecedented access. Gibney filmed Armstrong lounging in hotel rooms, joking with his inner circle, getting upset with surprise drugs tests at his home as his daughters look on. Armstrong also allowed Gibney to interview Michele Ferrari, his notorious "doping doctor", who admits with a grin to continuing to give Armstrong "advice" well past the date Armstrong had supposedly cut off ties.

"In all their arrogance, Armstrong and his team figured there was nothing to be discovered," Gibney told the Toronto international film festival the afternoon after the premiere of his film The Armstrong Lie. "So it ended up being a rather extraordinary opportunity to see something that was hiding in plain sight – but was actually there, we could find it."

What was "actually there" remains slightly murky in this nonetheless compelling documentary, which Gibney built from the fragments of his ruined Armstrong-comeback film. The cyclist himself admits on camera to years of doping (he could hardly do otherwise), and he reveals the tricks of the trade – including blood transfusions on a tour bus almost literally under the noses of a throng of media and cycling officials. Armstrong also continues to maintain, however, that his 2009 comeback was clean. Gibney responds by pointing to new evidence of suspicious blood tests.

But that's fighting on Armstrong's territory: plausible deniability by a hyper-competitive personality. As Gibney narrates, "Armstrong even tried to dominate my documentary." To Gibney's credit, this lucid, clear-headed film takes the battle elsewhere: namely, into the arena of smoke and mirrors that was the rise of the Armstrong brand. Gibney focuses the narrative drama on the 2009 comeback, but also gives plenty of stage time to the whistleblowers, former teammates and journalists whose reputations were damaged by daring to speak out against cycling's golden boy. Armstrong himself is cast as the wizard of Oz in a game of hype and intimidation.

As well the unique behind-the-scenes footage and the interview with Ferrari, we get damning evidence of deception in the highest ranks of the UCI. Armstrong himself admits there were "hundreds" of conversations with UCI officials where he was warned his drug tests were "flying too close to the sun". UCI head Hein Verbruggen comes off particularly badly, as Gibney implies a conspiracy designed to protect the sport's most wildly lucrative icon. It's not just the UCI that appears complicit, either. As the Livestrong cancer foundation grows, so much emotion comes to be invested in Armstrong's story – from sufferers to cycling fans to corporate sponsors to media – that it seemed at times as though everyone had hitched their wagon to the Texan's carbon-fibre frame.

Those who went off-piste attracted torrents of abuse. Gibney's contributors told the Toronto film festival after the premiere that they refused at first to speak to him out of mistrust. "We were inside Armstrong's bubble," Gibney said, "and everybody outside the bubble was very suspicious of us." Armstrong's story is less about doping than about divide-and-conquer: it's a story, Gibney shows, about power.

Gibney's film also shows that the Tour has always involved drugs of one kind or another, starting with alcohol; he unearths hilarious old footage of Tour cyclists leaping from their bikes to raid the bars of roadside brasseries. In the mid-90s context of EPO, the blood-oxygen booster for which a detection test had not yet been developed during Armstrong's era, it was dope or go home. Armstrong was simply the best organized, most cunning of the dopers. Most of those cyclists who chose never to touch the stuff, we simply haven't heard of: they never won a thing.

If The Armstrong Lie doesn't quite have the tragic beauty and natural symmetry of the racing documentary Senna, it nevertheless succeeds as a probing look into the mechanics of an epic lie, and because of the emotion at its heart. And of course the irony is that it also stars a figure of magnetic charisma. Even when the subject is his own disgrace, Lance Armstrong carries the story.