Ainslie joined two-time Olympic champion Iain Percy, Matt Cornwall and Christian Kamp to race in memory of their friend Andrew Simpson at the Argo Group Gold Cup in Bermuda, the fifth leg of the World Match Racing Tour.
Simpson, who won Olympic gold in 2008, died during a training accident for the recent America's Cup in San Francisco.
Despite focussing the last year on the hi-tech America's Cup catamarans, Ainslie, the world match racing champion in 2011, quickly adapted to regatta's one design class, a 1930's racing sloop.
He progressed through the qualifying and knock-out rounds and took the best of five final to the last race before being edged out by Italy's Francesco Bruni.
But four-time Olympic champion Ainslie and crew had another motivation for racing, a charity auction in Bermuda raising more than £53,000 for the Andrew Simpson Sailing Foundation, which aims to encourage children to go sailing, by providing both equipment and coaching facilities.
"Francesco and his guys sailed brilliantly all week," admitted Ainslie. "I think it was a great final to go 3-2. We are obviously here for other reasons.
"Obviously my lack of practice was shining through and I had a really bad day. I let the guys down a bit on that.
"It was just the final decision on which side to take and sometimes you had to make a decision if you wanted to push hard enough for a certain side of the course over a better start. I was making those calls wrong."