The 26-year-old singer and 46-year-old actress attended Lopez's residency show at Zappos Theater at Planet Hollywood.
Gomez thanked Lopez for inspiring her and other female artists in an Instagram Stories post the next day. She shared a screenshot of a text she sent Lopez after the show.
"You were absolutely incredible tonight!!" the star wrote. "I haven't felt that free in my entire life! Lol THANK YOU!!"
"I just wanted to tell how amazing god thinks you are!!!" she added. "He was speaking to me through your show tonight!! Like made me feel like a woman!! Lol I love you so much!"
Jessica Alba, Sarah Michelle Gellar, Dua Lipa, Becky G and Lopez's boyfriend, retired New York Yankees star Alex Rodriguez, also attended the concert. Lopez partied with Vergara and the group after the show.
"Fun night w these beauties... @jessicaalba @dualipa @iambeckyg @sofiavergara and @arod he's a beauty too #allihavefinal15 #show5 #4showstogo #letsgetit @phvegas," Lopez captioned a group photo on Instagram.
Alba also posted a group picture on her own account.
"Awesome show @jlo #vegas," she wrote.
Lopez kicked off her All I Have residency show in January 2016, and will bring the venture to a close Sept. 29. She last released the single "Dinero" featuring DJ Khaled and Cardi B in May.