Listen to this article
Three-time event winner Sainz started first on the road in the 457km test from Bisha to Wadi Ad-Dawasir following his victory in Stage 1 on Sunday, but had already slipped behind Peterhansel by the second waypoint at the 46km mark.
Once out in front, Peterhansel slowly started stretching a lead in his Mini buggy, his advantage stretching to 1m31s in the first 220km as Sainz continued to drop behind.
However, this was as big a buffer Peterhansel could build, as Al-Attiyah rapidly started eating into his advantage from the sixth waypoint and finally grabbed the lead at the 315km mark.
The Qatari driver eventually won the stage by over two minutes from Peterhansel, marking a massive turnaround in fortunes following a dismal 10th-place finish in the opening stage.
However, the 12 minutes he lost on Sunday means he sits only third overall in the standings, nine minutes in arrears of Peterhansel and three minutes behind second-placed Sainz.
After running neck-to-neck with Peterhansel on Sunday before claiming a narrow 25-second win, Sainz's deficit to his teammate stretched to 6m37s, the gap widening by nearly five minutes in the 22km stretch between waypoints seven and eight.
Behind the leading trio, Overdrive Toyota driver Yazeed Al Rajhi and Century's Mathieu Serradori finished fourth and fifth, the duo separated by just three seconds at the finish.
The result allowed Serradori to remain fourth in the general classification, while Al Rajhi provisionally moved inside the top 10 following his 16th place finish on Sunday.
After a nightmare start to his fifth Dakar outing with three punctures and navigational errors, nine-time World Rally Champion Sebastien Loeb bounced back strongly on Monday to set the sixth-fastest time in Stage 2.
This has helped the 46-year-old, driving for the Prodrive-run Bahrain Raid Xtreme team, to jump from 22nd to seventh in the overall order, although he has already slipped more than half an hour behind fellow Frenchman Peterhansel.
Century driver Brian Baragwanath was another driver to break inside the top 10 following a disappointing showing in Sunday's leg, jumping from 21st to eighth with the seventh-fastest time of the day.
Overdrive man Jakub Przygonski finished less than a minute behind Baragwanath in eighth, but gained four places overall to move up to fifth ahead of Al Rajhi.
The top 10 in the overall standings is completed by another Overdrive driver, Bernhard Ten Brinke, and the second BRX1 of 2014 winner Nani Roma.
Sainz: COVID means "double the pressure" on 2021 Dakar Rally
Al-Attiyah had to "attack from day one" of Dakar in "open" victory fight