It did not look good for Anthony D. Weiner.

Campaigning in a Brooklyn bakery during his ill-fated 2013 comeback bid for New York City mayor, Mr. Weiner — he of sexting scandal fame — was caught on tape hurling insults at an unhappy voter. Reporters pounced: Mr. Weiner, after weeks of brutal coverage, had finally become unhinged.

But the candidate was holding an ace: Josh Kriegman, a former aide and aspiring filmmaker, who had persuaded Mr. Weiner to let him tag along, camera in hand, for the entirety of the campaign. His microphone picked up what television crews had not: the voter sneeringly referring to Mr. Weiner’s Muslim wife as “an Arab.”

The campaign distributed the footage to news outlets, prompting corrections and even an on-air mea culpa from Jon Stewart. “We were happy to correct the record,” Mr. Kriegman recalled.

Now Mr. Kriegman’s careful chronicling of Mr. Weiner’s campaign is poised to prompt a much broader reassessment of a tabloid-tarred politician. “Weiner,” a feature-length documentary by Mr. Kriegman and Elyse Steinberg, will be released on May 20, amid one of the most contentious presidential elections in memory, and it may be the most intimate and provocative portrait of a political race since “The War Room.”