Sotomayor, 57, the court's first Hispanic justice, paid tribute to the city in the speech she delivered on her favorite team's field after being awarded an honorary Doctor of Laws degree.
"Every time I cross a bridge or pass through a tunnel to come into this city, my heart sighs with joy," she said to roars from purple-draped graduates shaking noisemakers. "I love this city and all it has given me."
The spirit of New York and its "feeling of constant challenge" will remain with NYU graduates for their entire lives, she said.
Sotomayor, who grew up in the Bronxdale Houses and went to Cardinal Spellman HS, used her own life story as reason for graduates to dream big.
"Under this cloudy Bronx sky that has held off from raining stands a Supreme Court Justice who grew up in a Bronx housing project," she said. "Nothing in my childhood hinted to me that I would be in a position someday to be in this position and to speak to such a large crowd."
Sotomayor, who was confirmed for the court in August 2009, encouraged graduates to admit when they don't have answers, remain hopeful despite anxiety about a tight job market and maintain a lifelong excitement about learning.
"The key to success is continuously maintaining an ever-present curiosity," she said.
University president John Sexton spoke about the long-term effects of an NYU education.
"We hope that you will carry in you the indomitable spirit of NYU," he said.
Honorary degrees were also awarded to New York Times columnist David Brooks, French Roman Catholic priest Patrick Desbois and Swiss microbiologist Charles Weissmann.