Cueto appeared to tweak the groin while throwing a pitch in the sixth inning. A team trainer checked on him with Andrew Toles at bat. Cueto stayed in and walked Toles, then motioned that he was done.
"I felt uncomfortable," Cueto said through an interpreter. "It was bothering me, so that's why I didn't finish the inning."
Describing what it felt like, he said, "Felt like a crab bit me."
Cueto was replaced by reliever Steven Okert with the Giants holding a 1-0 lead over the Dodgers, who had two men on base with one out.
Cueto threw 5 scoreless innings and allowed eight hits, with two walks and eight strikeouts.
"I am frustrated because we are right in there fighting for the playoffs," he said. "I have never had an injury like that. It's tough because there are still about 11 games left. A lot of baseball left."
The Giants are five games behind the Dodgers in the National League West and in a three-way tie for the first NL wild card after Tuesday night's win.
Also sidelined was Giants shortstop Brandon Crawford, who exited the game in the second inning with a dislocated left pinkie finger after sliding headfirst into third base.
An X-ray was negative, and the Giants said he is day-to-day.
Crawford was injured sliding into third base when he was thrown out trying to advance from first. He said a trainer popped his finger back into place after he came out of the game. He was wearing a splint afterward.
"At first I was hoping it was just jammed," Crawford said. "I went down to kind of feel it when I was on the bag and felt that it was out of place."
The Associated Press contributed to this report.