The Briton saved two match points to win 4-6 7-6 (7-4) 7-5 before an angry exchange with the Latvian at the net.
Ostapenko claimed her racquet slipped from her hand in the second-set tie-break and was let off with a warning.
Broady disagreed saying her opponent should be "straight disqualified".
"You'll see on the replay, there's no way it was accidental. She threw the racquet and it hit the ball boy," British number three Broady told the umpire in an on-court exchange.
WTA rules state that "players shall not at any time physically abuse any official, opponent, spectator or other person...for the purposes of this rule, physical abuse is the unauthorised touching of an official, opponent and spectator or other person".
Players can be disqualified for incidents by the umpire and fined up to $10,000 (£6,830) for each violation.
Former British number one Tim Henman was disqualified from Wimbledon in 1995 after accidentally hitting a ball girl with a ball struck in frustration, while David Nalbandian was thrown out of the Queens final in 2012 after kicking out at an advertising hoarding, cutting the shin of a line judge.
World number 88 Ostapenko, ranked 38 places higher than Broady, was allowed to continue after a tour supervisor was called to court, with Broady appearing to be near tears over the incident.
The Briton knuckled down in the third set, reeling off six successive games to snatch victory before becoming involved in an argument following the post-match handshakes.
"Jelena commented that my behaviour was terrible, which I thought was a bit out of order considering the events that had gone on in the match," said Broady of the row.
Broady, who beat former world number one Ana Ivanovic in the first round, will now play American Sloane Stephens.
Naomi Broady is into the ASB Classic third round after a controversial match against Jelena Ostapenko, who escaped disqualification for appearing to throw a racquet towards a ball boy.