Ainslie got his first win in the London Games on Thursday afternoon in Race 7 in the Finn class in strong winds and big seas on the English Channel. He followed it up by passing Denmark's Hoegh-Christensen just before the finish in Race 8 to take third.
Ainslie sliced Hoegh-Christensen's lead from 10 points to three with two races to go before the medals race.
It helped Ainslie's chances that Hoegh-Christensen, who had dominated through the first six races, capsized in the day's first race and finished eighth. He was fourth in Race 8.
Ainslie had finished behind Hoegh-Christensen in each of the first six races.
Ainslie is trying to win his fourth straight gold medal and fifth straight Olympic medal overall to eclipse Denmark's Paul Elvstrom as the greatest games sailor. Elvstrom won four straight golds from 1948-60.
The top 10 sailors advance to the medals race. Total points carry over, and there are double points awarded during the medals race.
Hoegh-Christensen had 18 points and Ainslie 21. Croatia's Ivan Gaspic is third with 34 points.
It was a good day overall for the strong British team which piled up wins in other classes.
Defending Star gold medallists Iain Percy and Andrew Simpson went 1-2 to strengthen their lead over Brazil's Robert Scheidt and Bruno Prada, who went 3-5. The British lead with 13 points while the Brazilians have 22.
Scheidt is the last man to beat Ainslie in the Olympics, taking the gold in the Laser class in 1996 and leaving Ainslie with the silver.
Britain's 49er crew of Stephen Morrison and Ben Rhodes won both races Thursday to jump into silver medal position, 11 points behind Australians Nathan Outteridge and Iain Jensen. The Aussies went 10-6.
The British 470 team of Luke Patience Stuart Bithell went 2-1 in the opening races of their class.