I think it will work (just did quick dirty test) if you assign it to a variable first and then output it.
<% foo = render :partial => '/shared/panel', :locals =>{:title => "Some Title"} do %>
Here is some content to be rendered inside the panel
<% end %>
<%= foo %>