May 17 (Reuters) - Australian shares rose on Monday, driven by gold stocks on higher bullion prices, while Ampol and Viva Energy lifted the energy index after both fuel suppliers received a massive government funding to keep their refineries open.

The S&P/ASX 200 index was up 0.4% at 7,038.5 points, as of 0057 GMT. While the benchmark gained 0.5% on Friday, it clocked its biggest weekly drop since Feb. 26.

Energy stocks rose as much as 2.1% and eyed their best session in nearly two months, benefiting from a jump in Ampol Ltd and Viva Energy, while higher oil prices also helped.

Ampol and Viva Energy were the top gainers on the benchmark after the government announced A$2.3 billion ($1.79 billion) in support to keep the last two oil refineries operated by the companies open at least until 2030.

Gold stocks gained as much as 4.1% after data showed U.S. retail sales unexpectedly stalled in April and boosted the safe-haven metal's appeal.

The sub-index was on track to record its best one-day gain since April 16.

Heavyweight gold miner Newcrest Mining rose as much as 2.6% to hit its highest in more than three weeks, while Northern Star Resources gained up to 5.3% and eyed its best session in two weeks.

A rebound in major Wall Street indexes, including the tech-heavy Nasdaq further aided sentiment.

Technology stocks in Australia rose 1%, with software maker Xero Ltd rising 4.4% and leading gains on the sub-index.

Across the Tasman Sea, New Zealand's benchmark S&P/NZX 50 index rose 0.4% to 12,412.34 points.

Skycity Entertainment and NZX Ltd were the top gainers on the benchmark, up around 2.4% each.

($1 = 1.2882 Australian dollars) (Reporting by Harish Sridharan in Bengaluru, Editing by Sherry Jacob-Phillips)