The 18-year-old Bencic, who had never beaten a top-five player, won 6-4, 6-4 in the third round of the WTA and ATP hardcourt tournament.
"I am very happy. I'm really excited," Bencic said.
"I always watched her on TV or when I was a small girl she was my idol and a role model for me and for my game."
Wozniacki, a former Indian Wells champion who is seeded fourth, won her 23rd career singles title just two weeks ago in Kuala Lumpur.
Bencic had played Wozniacki, from Denmark, just once before in Istanbul, Turkey last year where she was crushed 6-0, 6-0.
Asked Monday what the biggest difference between the two matches was, Bencic joked, "I won a game."
"I played more solid," she added.
"In Istanbul I had too much respect and I was nervous. Today I really had a good game plan. I did what I had to do."
It is the first time in three attempts that the world number 37 Bencic has beaten a top five player but this is now her third career win over a top ten opponent.
Bencic, who was named the WTA Tour's Newcomer of the Year last year, beat world number seven Angelique Kerber and world number ten Jelena Jankovic during a brilliant run at the 2014 US Open before losing in the quarterfinals.
"It's all I was dreaming for and wishing for when I was a small kid," Bencic said.
"It's unreal I beat a top five player."
Bencic blasted two aces, broke Wozniacki three times and had just one double fault in the one hour, 40 minute match.
She said the key to beating the two-time US Open finalist was to limit her errors.
"What she wants is for you to make many mistakes, because she's really trying to play the rallies," Bencic said.
"That's what I tried to do today, to hold the rallies with her and wait for my chances. Just be patient and then don't look for the winner too early."
Wozniacki hit more aces (five) but made eight double faults and won just 11 points in total on her second serve.
Wozniacki has been playing some of her best tennis in a long time lately.
She won Indian Wells in 2011 and reached the final in 2010 and again three years later, but only reached the final in one other tournament the rest of 2013.
Following an exit in the round of 16 in last year's Indian Wells event, she went five months without making it to a final.
She began to turn things around in the 2014 US Open, where she lost in the final to Serena Williams.
Bencic next faces another former Indian Wells champ, Jankovic, who beat Wozniacki in the final five years ago.