Volkswagen man Ogier trailed erstwhile rally leader Ostberg by 3.3 seconds after the first five stages but turned that into a 26.1s advantage after the second quintet.
Four stage wins helped the 2013 World Rally champion to move clear of his Citroen rival as Ostberg failed to settle into the same rhythm as he found in the morning.
Ogier immediately cut his advantage to 1.2s with victory on SS6, before Ostberg tumbled out of the rally lead on SS7 when he dropped 17s and handed Ogier a 13.7s buffer - one the latter extended gradually over the next few stages as Ostberg continued to drop small chunks of time.
The Norwegian did claim victory on the final superspecial to end a tougher afternoon on a high, though his attention will likely turn to the second VW of Jari-Matti Latvala, who is just 16.4s behind in third and has little to defend from after a host of frontrunners had their rallies ruined late in the afternoon.
First, Mikko Hirvonen, who was running in the final podium position, ground to a halt as his M-Sport Ford Fiesta suffered a mechanical problem on SS8, just moments before Kris Meeke - set to move into third on his Rally Mexico debut - pulled off the road with damaged suspension.
Hirvonen's M-Sport team-mate Kubica then inherited fourth behind Latvala, but rolled on the penultimate superspecial after clipping a concrete bollard, and was forced to miss the day's final stage.
He may be awarded a notional time later, or could be forced to take a retirement penalty.
The dramatic end meant drivers that kept their noses clean were almost guaranteed to benefit, and so it proved with Elfyn Evans, Thierry Neuville and Martin Prokop making the most of rivals' misfortune to complete the top six.
Evans delivered a solid afternoon's running to steer clear of trouble while Neuville looked much stronger on the afternoon's short and long stages after struggling in the morning, and brought his Hyundai to within a few seconds of Evans's Fiesta.
The Belgian was credited with a loss of nearly three minutes on the final superspecial - a legacy of yellow flags caused by Kubica's roll - but should be fifth when that is accounted for.
His team-mate Chris Atkinson's miserable day continued however as he almost emulated Kubica's roll at the same troublesome hairpin on SS11, but rescued it before the i20 toppled over.
Leading positions after SS11
Follow Rally Mexico as it happens with AUTOSPORT Race Centre Live
- Sports & Recreation