New Zealand has not lost a match since winning the first Commonwealth Games sevens tournament at Kuala Lumpur, Malaysia, in 1998, then subsequent events at Manchester, England in 2002 and Melbourne, Australia in 2006.
The Australians led for most of the second half in the final but Forbes put the New Zealanders ahead with a try inside the last four minutes. Baker crossed in the last minute to extend the winning margin.
In the bronze medal match, Isoa Damudamu scored the winning try with just over a minute left as South Africa beat England 17-14.
Samoa, the 2010 IRB sevens champions, was knocked out in the quarterfinals by England but the Pacific Islanders stepped up in the Plate Final for fifth place, swamping Scotland 34-0. Mikaele Pesamino and Afa Aiono scored two tries each for Samoa.
Papua New Guinea beat Canada 17-10 in the Bowl Final for seventh place.
Lote Raikabula opened the scoring for New Zealand in the fifth minute on a converted try that appeared to come off a ball that moved forward from a knock-on. With New Zealand's Liam Messam off for two minutes and with a yellow card for a high tackle, Lachie Turner scored Australia's first try two minutes later.
Luke Monaghan regathered after a 40-meter kick and chase to put Australia 10-7 with no time left on the clock in the first half. James Stannard put Australia up 17-7 but Sherwin Stowers' try with six minutes pulled New Zealand to 17-14 and the New Zealanders added two more tries.
Before the final, Forbes said a recent close encounter with his razor has given him some extra strength.
"It's a tradition for me to shave it now and again," Forbes said of his bald head. "It's not superstitious, it's a bit like the old Spartan days of going in to battle. I guess it makes me feel fresh and a bit aerodynamic on the field."
Earlier Greg Barden scored a first-half try and Ben Gollings converted as 2006 silver medalist England edged the Samoans 7-5 in the quarterfinals. Barden's try came two minutes after Alatasi Tupou gave Samoa the lead with a try before a boisterous crowd at Delhi University spurred on by a Conquistador-style trumpet recording.
New Zealand beat Wales 31-10, Australia defeated Kenya 27-5 and South Africa beat Scotland 10-7 in the other quarterfinals.
Sevens rugby features two seven-minute halves, although the tournament final had two halves of 10 minutes each. Other rule differences from 15-a-side rugby include the scoring team kicking off to its opponents instead of again receiving the ball, three-man scrums and using dropkicks for conversion attempts.
Australia has also had no success against New Zealand recently in the traditional 15-man game, losing 10 matches in a row to the All Blacks.
Missing from the New Delhi tournament was perennial Sevens powerhouse Fiji, which has been suspended by the Commonwealth for political reasons and was ineligible to compete.
This was New Zealand's third gold medal at the Delhi games. The others were won by cyclist Alison Shanks and shot putter Valarie Adams.
Rugby sevens will be on the Olympic program for the 2016 Rio de Janeiro Games.