Lorient took the lead through a Arnold Mvuemba penalty before two Aubameyang goals saw the home side turn it around.
Mathias Autret levelled for the visitors and a draw appeared likely before Bakary Sako scored two minutes from time with Aubameyang wrapping up victory, and his hat-trick, with a last-minute strike.
St Etienne started the match in sixth but neither side showed much as an attacking force in the first half with Aubameyang shooting across goal and Maxime Barthelme’s shot for Lorient intercepted by Jean-Pascal Mignot.
However, it was a different matter in the second half with the visitors going ahead four minutes after the break.
Innocent Emeghara was brought down in the box by Sylvain Marchal and Mvuemba fired the penalty into the centre of the goal.
There was controversy two minutes later when St Etienne were awarded a penalty when Lamine Kone was penalised for handball, a decision the referee revoked after consulting with his assistants.
The hosts levelled, though, in the 56th minute when Aubameyang fired across Benjamin Lecomte and the same player was denied soon after when Bruno Ecuele Manga cleared off the line.
St Etienne then took the lead midway through the half when Aubameyang headed home Sako’s cross but Lorient were back on level terms with a quarter of an hour remaining when Autret controlled Mveumba’s ball before slotting beyond Stephane Ruffier.
The game appeared destined for a draw but with just two minutes left Sako fired a left-footed shot across Lecomte and victory was sealed in the last minute when Aubameyang controlled Max Gradel’s ball before volleying home for his third.