The eighth-seeded Serb converted only five of the 20 break points she earned against her opponent. Errani broke three times and even served for the first set at 5-4.
"I knew I had to work hard for my points today, and I'm very happy I did that," Ivanovic said. "And I kept my composure."
Ivanovic, who beat Dinara Safina in last year's final, pulled out of this month's Madrid Open with a knee injury, and her right knee was taped Sunday at Roland Garros.
She finished the match with seven double-faults and six aces, while the 44th-ranked Errani did a good job of moving her around the court.
"Even though I had some time off during the Madrid tournament, I feel like it takes only few days to get back in shape," Ivanovic said. "I feel very fit."
Both players questioned calls on the red clay, but Ivanovic was on the winning side of a crucial challenge in the tiebreaker. At 1-1 with Errani serving, the Italian hit a ball wide that Ivanovic returned. Errani then sent a winner to the other side of the court on her next shot and believed she had taken the lead, but Ivanovic called for the chair umpire, who checked the previous mark and overruled the call.
Errani stood at the net and complained, but the call stood and Ivanovic won the next two points on serve to take a 4-1 lead.
The 21-year-old Ivanovic also reached the final at Roland Garros in 2007, and last year's Australian Open final. She was the world's top-ranked player for 12 weeks in 2008 but has dropped to No. 8.
"I just have to keep my head down and work tough through the matches," Ivanovic said about her chances at this year's French Open. "There [are] no easy points."
The 29-year-old Mauresmo has never advanced past the quarterfinals at her home Grand Slam tournament, losing at that stage in 2003 and '04.
The two-time Grand Slam champion, who lost in the second round at Roland Garros last year, won her 25th career title at the Paris Indoors in February.
No. 11 Nadia Petrova reached the second round by easily beating 18-year-old Lauren Embree of the United States 6-1, 6-2.
Ninth-seeded Victoria Azarenka of Belarus advanced.
Also, 25th-seeded Li Na of China defeated Marta Domachowska of Poland 6-4, 6-2, 27th-seeded Anastasia Pavlyuchenkova of Russia beat Ioana Raluca Olaru of Romania 6-3, 6-2, and 32nd-seeded Iveta Benesova of the Czech Republic advanced when Julia Goerges of Germany retired while trailing 7-5, 4-1.
"For each match point, I was very confident," Johansson said. "I thought I would win it, and I missed the first one, and I was pretty nervous on the second, and it was more difficult for me to play."
Information from The Associated Press was used in this report.