Cardiff's Techniquest was already told it could lose the government cash by 2019 but it has now been given more time to make new plans.
The centre, which around Â£850,000 annually from ministers, said it needs to find new "revenue streams".
Funding worth about Â£450,000 for its sister but separate charity in Wrexham is also ending over the same period.
The 30-year-old Cardiff organisation has relied on Welsh Government funding for 40% of its income.
Since 1986, it has had more than five million visitors, including at least 1.5m school pupils on organised trips.
It moved from Cardiff city centre to Cardiff Bay in 1995.
A separate group runs a site at Wrexham's Glyndwr University campus, which opened in 2003.
Lesley Kirkpatrick, chief executive officer at Techniquest, said: "Last year, we were made aware that the core funding to Techniquest would reduce and eventually come to an end.
"Consequently we were expecting a funding cut next year and in subsequent years.
"Our core grant from the government will continue until 2021, allowing us time to explore other options, and we are extremely grateful for this.
"There are a number of plans being developed which will help us identify alternative revenue streams and secure the long-term sustainability of Techniquest."
Iwan Thomas, chairman of the board of the Wrexham Techniquest Glyndwr site, said: "We've already been proactive at looking at alternative funding streams.
"We are looking at extending our remit so it ties in with regional and cross-border economic opportunities and the needs of the STEM [Science, Technology, Engineering and Mathematics] agenda."
He said he did not think the site would close as a result of the funding cut, adding: "We are mature enough in Wrexham to look outside of the box".
The decision by Cabinet Secretary for Education Kirsty Williams comes after former education minister Huw Lewis said in January that Techniquest was "overly dependent on public funds".
"It's not a sustainable position," he had told AMs at the time.
It is understood that the grant will be reduced each year.
A Welsh Government spokesman said: "We are working closely with Techniquest and Techniquest GlyndÅµr to support their move to a more sustainable financial position, without reliance on Welsh Government core grant funding.
"Both organisations have agreed to a five-year programme of support (from 2016-17) to help better manage the reduction in core funding and we will continue to work closely with them to explore any other funding opportunities in future."
Funding for two Techniquest science museums in Wales will end from April 2021, the Welsh Government has said.