The 83rd-ranked Lajovic saved 8 of 9 break points he faced against the 75th-ranked Sock, who was born in Nebraska and was trying to join John Isner as the first American men in the fourth round at Roland Garros since 2010.
Before this French Open, the 23-year-old Lajovic had a 10-21 career record in tour-level matches, never winning two in a row.
Sock, 21, has yet to reach the final 16 at a major.
Fellow American Donald Young was thwarted in his comeback attempt by Guillermo Garcia-Lopez, who beat Young 6-2, 6-4, 2-6, 6-7 (4), 6-4 to advance, making Isner the only American man in the fourth round.
The 41st-ranked Garcia-Lopez, who surprised No. 3 Stan Wawrinka in the first round, is in the final 16 at a major tournament for the first time.
Young, who is from Chicago, was trying to pull off his first victory in a match after dropping the first two sets, but Garcia-Lopez closed it out after more than 3½ hours.
Ferrer improved to 7-0 against Seppi, winning all 15 sets they've played. Ferrer, who has lost a total of 26 games through three matches this year in Paris, will face No. 19 Kevin Anderson of South Africa for a place in the quarterfinals.
Anderson advanced when Ivo Karlovic retired after one set Saturday because of a bad back.
The Associated Press contributed to this report.