The UK and Scottish governments and Dundee City Council have agreed a public service obligation (PSO) contract worth almost Â£3.7m.
Loganair will continue to operate the route from 26 March.
The service will see two return flights each weekday and one return flight on a Sunday.
The UK Government will contribute 50% of the total funds, with the Scottish government putting in Â£1.4m and Dundee City Council providing Â£400,000 of funding.
UK Aviation Minister Lord Ahmad of Wimbledon said: "I am delighted that Loganair will continue to operate this direct air service between Dundee and London Stansted for another two years.
"Passengers and businesses will continue to benefit from the connectivity this route provides. It will further boost trade and tourism opportunities will continue to flourish in Scotland."
Scotland's Transport Minister Humza Yousaf said: "The award of this contract to Loganair is welcome news which provides continuity of service on this important route.
"This flight not only provides a direct link to London, but also offers passengers a wide number of onward connecting destinations from Stansted. This will continue to benefit business and leisure travellers alike."
Dundee City Council leader Ken Guild added: "Securing the route for a further two years through this latest PSO gives the council and its partners an opportunity to build on the service and attract other routes."
The UK government funding is through the Regional Air Connectivity Fund, which aims to maintain connectivity between London and smaller regional airports, where routes are at risk of being withdrawn.

Lufthansa lost an appeal to a Frankfurt labour court, but is making a further legal challenge that could go late into Tuesday evening.
The pilots' strike, called over a pay dispute, will affect around 100,000 passengers, Lufthansa said.
The industrial action is part of a long-running pay dispute at Lufthansa.
The pilots' union Vereinigung Cockpit (VC) has organised 14 strikes since April 2014.
Short and medium-haul flights from Germany will be affected from 00:01 to 23:59 local time (23:01-22:59 GMT).
Flights by Lufthansa's other airlines including Eurowings, Swiss, Austrian Airlines, Air Dolomiti and Brussels Airlines are not affected by the strike, the airline said.
Pay talks between the Vereinigung union and the German airline broke down earlier this month, and Lufthansa said the union had "consistently rejected the offer" of mediation.
The union is calling for a 3.7% pay rise for 5,400 pilots dating back to 2012.
Lufthansa, which is facing increasing competition from budget rivals, offered a 2.5% increase over the six years until 2019.
Meanwhile, a separate dispute with cabin crew at Lufthansa's low-cost subsidiary, Eurowings, led it to cancel more than 60 flights on Tuesday.

The preliminary Caixin manufacturing purchasing managers' index (PMI) fell to 47 in September, below forecasts of 47.5 and down from 47.3 in August.
A reading below 50 indicates contraction in the sector, while one above shows expansion.
The Shanghai Composite dropped 2.2% to 3,115.89 on the disappointing data.
The private survey also marked the seventh consecutive month of contraction in the sector.
In Hong Kong, the Hang Seng index closed down 2.3% at 21,302.91.
Japanese markets are closed for a three-day public holiday and will reopen on Thursday.
In Australia, shares in mining companies were hit by falling commodity prices.
Oil prices continued to decline after US crude fell 2% overnight on global growth concerns, while copper prices slipped further on slowing Chinese demand.
Sydney's S&P/ASX 200 index closed down 2.1% at 4,998.10.
In South Korea, the Kospi index ended 1.9% lower at 1,944.64 following the release of the data from China.

The 22-year-old has not appeared for Shrewsbury this season, but has played once for Mansfield Town and four times for Wrexham while on loan.
Bolton youth product Caton has also played for Blackpool and has loan spells with Accrington and Chester before joining Shrewsbury in 2014.
Caton follows Jamie McCombe, 33, in signing for the National League side.
The centre-back, who played 101 games for the club during his first spell, has left Stevenage and signed a contract until the end of the 2016-17 season.
A new deal to secure the air link between Dundee City Airport and London Stansted for another two years has been announced.
[NEXT_CONCEPT]
German airline Lufthansa is making an eleventh-hour court appeal to halt a planned pilots' strike that will cancel 900 flights on Wednesday.
[NEXT_CONCEPT]
Asian markets headed lower after a survey of China's manufacturing sector indicated it is shrinking at the fastest pace for six-and-a-half years.
[NEXT_CONCEPT]
Lincoln City have signed Shrewsbury winger James Caton on loan until the end of the season.