In far sharper exchanges than during last month's pedestrian first debate, Sarkozy came under fire for his record in office from 2007 to 2012 and spent much of the two hours on the defensive.
But a poll of viewers immediately afterwards showed that among supporters of his Republicans party, Sarkozy had edged the long-time frontrunner in the polls, former prime minister Alain Juppe, by 31 percent to 28 percent.
However, Juppe was a clear winner with 34 percent to Sarkozy's 24 percent when voters of all political persuasions were taken into consideration, reflecting his status as France's most popular politician.
The right-wing primary over two rounds on November 20 and 27 is crucial because the winner is widely expected to become the next president in May.
Anyone can vote in the primary providing they pay a small fee.
With headlines in France dominated in recent weeks by the demolition of the squalid "Jungle" refugee camp in Calais, his rivals assailed Sarkozy for negotiating the agreement that effectively moved Britain's border on to French soil.
They said the Le Touquet treaty had led to camps sprouting at Channel ports and now, increasingly, in Paris.
But on a day when the last residents were bussed out of the now-defunct "Jungle" on the north coast to accommodation centres elsewhere, Sarkozy said the onus was squarely on Britain to share the burden.
"Most of the migrants want to go to England. So we should go to England, see (British Prime Minister) Theresa May and renegotiate these agreements," Sarkozy said.
Bruno Le Maire, who like three other candidates served in Sarkozy's government, recalled that the former president had gone back on a promise he made to leave politics following his defeat by Socialist Francois Hollande in 2012.
"Some promised to never stand again if they were beaten," Le Maire said.
Sarkozy hit back: "Try first to get elected -- then you'll see how difficult it is."
The former president also had a feisty exchange with the only woman among the seven candidates, Nathalie Kosciusko-Morizet, who was minister for the digital economy in Sarkozy's administration.
"I don't regret appointing you (to the government). I'm not sure I'd do it again, but I don't regret it," Sarkozy told her.
"You won't have the opportunity," Kosciusko-Morizet replied icily.