Teenager Lucy Hamilton has taken the equal-second best figures in WBBL history to lead the Brisbane Heat to a crucial six-wicket win over the Melbourne Stars.